Repository navigation
Redaction: letter-only URL tokens and unpadded base64 secrets - #354
Conversation
Token-only URL userinfo counts at 16+ characters, letters only included. Base64-style values are told apart from relative paths by Shannon entropy instead of requiring + / = or exactly 40 characters.
PR Summary by QodoRedact letter-only URL tokens and unpadded base64 secrets
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
The entropy check alone let low-entropy AWS-style keys through. The fixtures named *_TOKEN / *_SECRET were blanked by name before the value rules ran, so the tests did not cover them.
Redaction: keep the 40-character key rule, test value rules directly
Summary
Third round of Qodo follow-ups for the v2.4.0 release, on top of #353. Both comments on #353 were valid: two kinds of credentials still showed in the project API and UI.
Stacked on #353: merge this into
fix/release-240-review-2first, then #353 intofix/release-240-review, then #352 intodevelop.What changed
secret-redaction.ts): any userinfo of 16 or more characters without a password counts as a token, letters only included, sohttps://abcdefghijklmnop@host.example/repois blanked. Short usernames likessh://git@github.comstay visible.secret-redaction.ts): base64-style values are now told apart from relative paths by Shannon entropy, as secret scanners do, instead of requiring+,=or exactly 40 characters. Path segments are words and score about 4 bits per character; random keys score 4.5 and up. The threshold is 4.3.+or=still count as a sure sign.A blanked value is only hidden in the display. Saving the server keeps the stored value, so a false positive costs nothing beyond showing a blank field.
Test plan
https://abcdefghijklmnop@host.example/repoandAbcdEFGH/ijkLMNO1234567890QRSTUV(both from the review), plus all earlier cases.ssh://git@github.com/org/repo.git,opt/ghidra11/support/analyzeHeadless,services/payments/api/v2/handlers, and the absolute and Windows paths.bunx tsc --noEmit; the server suite has no assertion failures (only the known Windows EBUSY temp cleanup).Checklist
bunx tsc --noEmitpasses🤖 Generated with Claude Code