fix(review): escape fix handoff paths - #4082
Merged
JSONbored merged 1 commit intoJul 7, 2026
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4082 +/- ##
=======================================
Coverage 93.63% 93.63%
=======================================
Files 384 384
Lines 35822 35825 +3
Branches 13146 13146
=======================================
+ Hits 33543 33546 +3
Misses 1618 1618
Partials 661 661
🚀 New features to boost your workflow:
|
Contributor
|
Important 🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪 🔍 Gittensory is reviewing…AI analysis is in progress. This comment will update when the review is complete. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing |
JSONbored
deleted the
codex/fix-markdown-injection-in-fix-handoff-comments
branch
July 7, 2026 23:58
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.
Motivation
finding.pathdirectly into an inline-code markdown span, which allowed adversarial paths containing backticks, pipes, brackets, or markdown link syntax to inject rendered markdown into the public unified review comment.Description
markdownPathCodeTextinsrc/review/fix-handoff-render.tsthat neutralizes backslashes, backticks, pipe characters, and angle brackets before composing the inline-code location label.safePath) when building thelocationstring inbuildFixHandoffBlockso the renderedbodycontains a markdown-safe inline-code span.test/unit/fix-handoff-collapsible.test.tsthat supplies an adversarial path with a backtick, markdown link, pipe, and angle brackets and asserts the rendered block body contains the escaped form while the raw structuredpathfield remains unchanged.Testing
npm test -- --run test/unit/fix-handoff-collapsible.test.ts, all tests passed (11/11).npm run typecheck, which succeeded withtsc --noEmit.git diff --check, which reported no issues.npm run test:ci, which did not fully complete due to environment/registry drift (the existingcf-typegen:checkreportedworker-configuration.d.tsstale); this is unrelated to the patch itself.npm run test:coverage -- --run test/unit/fix-handoff-collapsible.test.ts, the unit tests passed but coverage tooling failed withTypeError: jsTokens is not a functionin the environment.npm audit --audit-level=moderatefailed due to a registry/network403 Forbiddenfrom the audit endpoint in this environment; not related to the change.Files changed:
src/review/fix-handoff-render.ts,test/unit/fix-handoff-collapsible.test.ts.Codex Task