fix(signals): redact /root/ local paths on the public-safety boundary#1376
Merged
JSONbored merged 4 commits intoJun 26, 2026
Merged
Conversation
The signals public/private boundary treats /Users/, /home/, and /tmp/ (and Windows ...\Users\...) as local filesystem paths that must not reach public GitHub surfaces, but missed /root/ — the root user's home directory. A contributor running local branch analysis from a /root/... working tree (common in containers/CI/devcontainers) could leak that absolute path. The project already treats /root/ as a local path in miner-dashboard-recommendations.ts; this aligns the canonical boundary primitive (redaction.ts PUBLIC_UNSAFE_PATTERN) and the changed-file-path redactor (local-branch.ts safeRepoPath) with that intent. Behavior-preserving for all existing inputs; only adds /root/ detection. Fixes JSONbored#1375 Co-authored-by: Cursor <cursoragent@cursor.com>
|
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 #1376 +/- ##
=======================================
Coverage 95.37% 95.37%
=======================================
Files 192 192
Lines 20857 20857
Branches 7542 7542
=======================================
Hits 19892 19892
Misses 383 383
Partials 582 582
🚀 New features to boost your workflow:
|
24 tasks
JSONbored
approved these changes
Jun 26, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
Correct, first-filed, and complete — patches both boundary arms, which is right since either alone leaves a leak path. /root/ was the obvious omission next to the /Users/,/home/,/tmp/ family, and a CI/container tree lives exactly there. Green. Merge.
This was referenced Jun 26, 2026
Closed
Closed
Closed
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.
Summary
The signals public/private boundary treats
/Users/,/home/, and/tmp/(and Windows…\Users\…) as local filesystem paths that must never reach a public GitHub surface, but it missed/root/— the root user's home directory. A contributor running local branch analysis from a/root/...working tree (common in containers, CI, and devcontainers) could leak that absolute local path onto public surfaces.The project already treats
/root/as a local path to redact insrc/services/miner-dashboard-recommendations.ts:This PR aligns the canonical boundary primitive and the changed-file-path redactor with that established intent.
Changes
src/signals/redaction.ts— add/root/toPUBLIC_UNSAFE_PATTERN, the canonicalisPublicSafeTextboundary governing PR/issue comments, check annotations, notifications, badge, and extension payloads.src/signals/local-branch.ts— add/root/tosafeRepoPath, which redacts changed file paths rendered into the public PR packet'sChanged Pathssection (the most likely place a/root/...path appears).test/unit/redaction.test.tsandtest/unit/local-branch.test.ts.Behavior-preserving for every existing input — it only adds
/root/detection.Security / privacy notes
This strengthens the public/private boundary: an absolute
/root/...path is now redacted (isPublicSafeTextreturnsfalse; changed-file paths render as[local path hidden]) before reaching any public GitHub surface, consistent with the existing/Users/,/home/,/tmp/handling. No public output that was previously sanitized changes; only previously-leaking/root/...paths are now caught.Scope
Narrow, scoped to the canonical
signalsboundary primitive plus the changed-file-path redactor. Other surfaces that keep their own context-specific path denylists (control-panel-roles.ts,weekly-value-report.ts,db/repositories.ts,agent-action-explanation-card.ts,focus-manifest.ts) can be aligned in a follow-up.Validation
Run from the repo root (Node 22, after
npm ci):All pass locally.
npm cireportsfound 0 vulnerabilities. New behavior is covered by the added unit tests (changed source lines are exercised;safeRepoPath's changed line is additionally covered behaviorally via the PR-packet test).Linked issue
Fixes #1375