Repository navigation
fix: 修正 CodeQL js/redos 與 js/double-escaping 兩個真問題 - #12
Merged
Merged
Conversation
… attributes - markup: REFERENCE's character class already contains ".", so the trailing (\.X*)* group only added exponential backtracking. The simplified pattern accepts exactly the same strings (exhaustively checked for all strings up to length 6 over a small alphabet). - provider-hyperframes-local: decode & last so "&lt;" yields "<" instead of "<". - Record both fixes in docs/fork/DECISIONS.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LzPwoJBKJ97mwPJq3Uohmv
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The oracle regex in the test reintroduced the js/redos pattern that CodeQL flags; check the same language character by character instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LzPwoJBKJ97mwPJq3Uohmv
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修正
packages/markup/src/syntax.ts:14(js/redos):REFERENCE的字元類已含.,X*(\.X*)*會指數級回溯。改為/^[A-Za-z_][A-Za-z0-9_.:-]*$/u。A z _ 0 9 . : - !窮舉所有長度 ≤6 的字串(597,871 個)比對新舊兩式,0 筆不一致。packages/provider-hyperframes-local/src/sampling.ts:25(js/double-escaping):&改成最後還原,&lt;現在得到<,不再是<。docs/fork/DECISIONS.md加 2026-10-24 條目。CodeQL alert 編號在這個環境查不到(gh api .../code-scanning/alerts回 403),條目裡註明待補。測試
packages/markup/test/reference.test.ts:以原正則接受的語言(不用正則的逐字元判斷,避免測試本身再觸發 js/redos,見 99b4c4c)為對照,合法/不合法參考的結果不變(含長度 ≤4 的窮舉);"A.".repeat(30) + "!"要在 50ms 內被拒絕。packages/provider-hyperframes-local/test/sampling.test.ts:&lt;得<、&amp;得&,一般實體照常還原。rejecting 61 characters took 13027.5ms),解碼測試失敗(expected: 'a<b'、actual: 'a<b')。閘門(Linux 容器)
pnpm install --frozen-lockfile --ignore-scripts、pnpm check前後都通過。Windows 的tools/dev_check.ps1沒有在這裡跑。🤖 Generated with Claude Code
https://claude.ai/code/session_01LzPwoJBKJ97mwPJq3Uohmv