Skip to content

Commit 940dd98

Browse files
cameroncookeclaude
andcommitted
fix(doctor): Redact project names in PATH root entries
Treat as a valid delimiter when redacting project-name path components so PATH entries like /Users/me/SecretProject:/usr/bin do not leak the project directory name in default redacted doctor output. This preserves existing behavior for nested paths while covering the PATH root-component case reported in review. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 36cfc26 commit 940dd98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mcp/tools/doctor/doctor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function redactPathLikeValue(value: string, projectNames: string[], piiTerms: st
4444
let output = value.replace(USER_HOME_PATH_PATTERN, '/Users/<redacted>');
4545
for (const projectName of projectNames) {
4646
const escaped = escapeRegExp(projectName);
47-
output = output.replace(new RegExp(`/${escaped}(?=/|$)`, 'g'), '/<redacted>');
47+
output = output.replace(new RegExp(`/${escaped}(?=[:/]|$)`, 'g'), '/<redacted>');
4848
output = output.replace(
4949
new RegExp(
5050
`${escaped}(?=[.](xcodeproj|xcworkspace|xcuserstate|swiftpm|xcconfig)(?=$|[^A-Za-z0-9_]))`,

0 commit comments

Comments
 (0)