fix(mcp): redact a parenthesis/bracket/colon-prefixed local path in redactLocalPath - #6369
Conversation
…edactLocalPath
redactLocalPath's prefix delimiter class only recognized whitespace, quotes,
backtick, and "=" immediately before a local path -- missing "(", the Node.js
stack-frame shape ("at fn (/abs/path:10:5)"), so a real absolute path pasted
into validation output could leak upstream unredacted. Verified and closed
two adjacent gaps in the same class ("[" and ":") while at it, and excluded
"]" from the path-tail/segment patterns so a bracket-wrapped path redacts
cleanly instead of swallowing the closing bracket.
|
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 #6369 +/- ##
=======================================
Coverage 95.60% 95.60%
=======================================
Files 599 599
Lines 47221 47221
Branches 15024 15024
=======================================
Hits 45147 45147
Misses 1290 1290
Partials 784 784
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-16 05:36:19 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Closes #6258
Summary
redactLocalPath's prefix delimiter class ((^|[\s"'\=])) omitted(— the exact prefix Node.js stack traces use (at fn (/abs/path:10:5)). Verified directly: a(`-prefixed absolute path passed through completely unredacted, while a space-prefixed path redacted correctly.packages/loopover-mcp/lib/redact-local-path.js, consolidated by refactor(mcp): consolidate 3 separately-maintained local-path-redaction implementations #6264) rather than the two separately-duplicated copies the issue originally cited (local-branch.js/bin/loopover-mcp.js) — so this one fix closes the gap for every call site at once, including the validation-summary path that POSTs to the LoopOver API.[(bracket-wrapped paths, e.g.[/abs/path]) and:(colon-joined messages with no space, e.g.error:/abs/path) missing from the same class. Also excluded]from the path-tail/segment character sets so a bracket-wrapped path redacts cleanly ([<local-path>]) instead of swallowing the closing bracket into the match.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typechecknpm run test:coverage(full local run; pre-existing Windows-only environment failures unrelated to this change — docker-prune script exec-mode checks, path-separator/CRLF differences — are the only failures present, matching the established baseline on a clean checkout)test/unit/redact-local-path.test.ts: the exact reproduced parenthesis-prefixed stack-frame case, plus the two additional gaps found (bracket-prefixed, colon-prefixed-no-space).Safety