Skip to content

fix(runtime): notifications 域尾斜杠正则 polynomial-redos 修复(#3507 暴露的 CodeQL high) - #3510

Merged
os-zhuang merged 1 commit into
mainfrom
fix/notifications-redos
Jul 27, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
fix/notifications-redos

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

背景

#3507 把 handleNotification 体逐字搬进 domains/notifications.ts,搬迁让这行成为"changed code",CodeQL 首次扫到 path.replace(/\/+$/, '') 的 js/polynomial-redos(high)——该模式自 ADR-0030 就潜伏在原方法里,security 域的同款早已被拦并改为 split+filter(注释里就引用了这条规则),notifications 一直漏网。

修复

照 security 域先例:path.split('/').filter(Boolean).join('/')——不再对请求可控输入跑带量词回溯的正则。语义微差:子路径中的冗余斜杠折叠(//read// → read),与 security 域一致、方向更宽容,新增测试锁定。

验证

接缝套件 19 测试、runtime 全量 624 绿、DTS build 绿。

关联 #2462 / #3507。

🤖 Generated with Claude Code

…ions domain (CodeQL high from #3507)

The extraction PR moved the legacy `.replace(/\/+$/, '')` verbatim into
domains/notifications.ts, which made it "changed code" and surfaced a
js/polynomial-redos CodeQL alert that the line had latently carried since
ADR-0030. Fix is the same split+filter treatment the security domain
already uses for the identical pattern (its comment even cites the rule).
Side effect: redundant slashes collapse ('//read//' → 'read'), consistent
with the security domain; locked by a new test.

Verified: seam suite 19 tests, runtime 624 green, DTS build green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 27, 2026 2:07am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/s labels Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/runtime.

17 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/api/index.mdx (via @objectstack/runtime)
  • content/docs/api/wire-format.mdx (via @objectstack/runtime)
  • content/docs/automation/hook-bodies.mdx (via @objectstack/runtime)
  • content/docs/concepts/north-star.mdx (via packages/runtime)
  • content/docs/data-modeling/drivers.mdx (via @objectstack/runtime)
  • content/docs/deployment/index.mdx (via @objectstack/runtime)
  • content/docs/deployment/production-readiness.mdx (via @objectstack/runtime)
  • content/docs/deployment/single-project-mode.mdx (via @objectstack/runtime)
  • content/docs/deployment/vercel.mdx (via @objectstack/runtime)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/runtime)
  • content/docs/permissions/authentication.mdx (via @objectstack/runtime)
  • content/docs/permissions/authorization.mdx (via packages/runtime)
  • content/docs/plugins/packages.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/http-protocol.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/index.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/lifecycle.mdx (via @objectstack/runtime)
  • content/docs/releases/implementation-status.mdx (via @objectstack/runtime)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

This branch was successfully deployed

1 active deployment
Preview — 487b15a7 Deployed Jul 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant