Console writes URL credentials to the local log, though AGENTS.md says secrets never reach disk
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- security
Research direction
Open console/apps/switch-console-desktop/src/main/lib/file-logger.ts and read the SECRET_PATTERNS and PII_PATTERNS arrays alongside writeLogEntry and getDiagnosticLogAttachment to confirm which array each path applies. Then grep the file's existing tests for redaction cases and run them before and after moving the scheme://user:pass@ pattern into SECRET_PATTERNS. Done means a connection string passed through writeLogEntry no longer lands in switch-console.log with the password intact, while host and scheme survive.
Written by the indexing model from the issue text.
Description
Summary
console/AGENTS.md states that URL credentials are redacted on the write path and never reach disk. They are not: the pattern that catches them lives in PII_PATTERNS, which runs only when a log is exported. A password inside a connection string is written to the local log file in the clear.
Verified at switch-console-v0.41.1, in console/apps/switch-console-desktop/src/main/lib/file-logger.ts.
Detail
The logger splits redaction by destination, which is a good design and is documented as such:
redactSecrets()runs on every write (writeLogEntry), applyingSECRET_PATTERNS.redactDiagnosticLog()=redactPii(redactSecrets(...))runs only ingetDiagnosticLogAttachment(), the single point at which log content leaves the machine.
console/AGENTS.md describes the split this way:
Secrets (tokens, keys, JWTs, PEM blocks, URL credentials) are redacted on the write path by
redactSecrets()and must never reach disk.
But the URL-credentials pattern is in PII_PATTERNS, not SECRET_PATTERNS:
# PII_PATTERNS
# Any scheme://user:pass@ — covers postgres, mongodb, redis, mysql, amqp, https…
[/\b([a-z][a-z0-9+.-]*:\/\/)[^\s:/?#@]+:[^\s@/?#]+@/gi, '$1[REDACTED_CREDENTIALS]@'],
So postgres://user:[email protected]/switch in a log line is scrubbed in an exported diagnostic bundle but written verbatim to switch-console.log on disk.
SECRET_PATTERNS does catch a credential presented as a named key (password=, "password":), so the gap is specifically the credential embedded in a URL — which is the common shape for database and broker addresses, and exactly the shape a connection error is likely to log.
Why it matters
The stated invariant is that secrets never reach disk. This breaks it for a credential shape that is both common and high-value, and the local log is the copy users are most likely to open, copy from, or attach somewhere by hand.
It is also now a documentation problem: the Switch Rooms troubleshooting page is gaining a "Find the logs" section, and because of this gap it has to tell readers that "a password inside a server address can still appear" in their log.
Suggested fix
Move the URL-credentials pattern from PII_PATTERNS to SECRET_PATTERNS. It is a credential, not personal data, and nothing about local debuggability needs the password — the host and scheme survive the redaction either way. Export is unaffected, because redactDiagnosticLog already runs redactSecrets as well.
The alternative is to correct AGENTS.md instead, but that keeps a real secret on disk in order to preserve an accurate comment, which is the wrong way round.
- Dominant language
- Python
- Stars
- 4.5k
- Forks
- 348
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 287
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sandbox-quantum/switch
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#2162 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#2159 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#2157 ·
Maintainers usually reply within 1 day
-
Get-Switch-Console link points at a path that only resolves via a redirectPossibly taken @Darshan3690 claimed this 3 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#1998 · 2 comments ·
Maintainers usually reply within 1 day
-
A session's age is not surfaced, so you cannot tell how old an agent's context isPossibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sandbox-quantum/switch#1993 ·
Maintainers usually reply within 1 day
All issues in sandbox-quantum/switch
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mohanraj00/entelos#200 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
sweep
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
bketelsen/truenas-mcp#77 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openedx/xblock-lti-consumer#765 ·
Maintainers usually reply within 1 day
-
bug pydanty:is-working
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pydantic/pydantic-ai#13939 ·
Maintainers usually reply within 1 day