fix(review): defang grounding file paths - #4075
Conversation
|
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 #4075 +/- ##
=======================================
Coverage ? 93.56%
=======================================
Files ? 381
Lines ? 35477
Branches ? 13010
=======================================
Hits ? 33195
Misses ? 1621
Partials ? 661
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-07 23:51:32 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Motivation
file.pathdirectly into the reviewer prompt, allowing attacker-controlled filenames to inject prompt-like text into the AI prompt.Description
safeGroundingPath(path: string)which callsneutralizePromptInjection(path).textand escapes CR/LF to keep line breaks as data.pathinformatFilesSectionfor both inline and truncated file renderings so headings no longer contain raw filenames.src/review/review-grounding.tsandtest/unit/review-grounding.test.ts.Testing
git diff --checkwhich reported no issues.npx vitest run test/unit/review-grounding.test.ts --pool=forks --reporter=dotand all tests in that file passed (24 passed).npm run typecheckand it succeeded.npx vitest run ... --coveragebut the local coverage provider errored withTypeError: jsTokens is not a functionso full coverage collection could not be completed locally.npm audit --audit-level=moderatebut the registry audit endpoint returned403 Forbidden, preventing completion of the dependency audit step.Codex Task