Repository navigation
fix(pii): auth-only secret flags need a credential value (#198) - #203
Merged
Merged
Conversation
findSecretFlags masked the word after any flag LooksSecret accepts, so initdb's "--auth-local and --auth-host" hint lost "and". A flag secret only through "auth" now masks its value only when it looks like a credential and is no auth method name; a bare stop word is never a secret flag's value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: "--auth admin:pw" (httpie) and "--basic-auth admin:pw" would leak through the looksCredential test. Keep only a known method name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #198 (part 3 of DavidGodefroid/locklog#144).
findSecretFlagsmasked the word after any flagLooksSecret()accepts, so initdb's hint--auth-local and --auth-hostcame back as--auth-local ⟦secret⟧ --auth-host.authtoken (--auth,--auth-local,--auth-host; not--auth-token,--auth-key) keeps a known auth method name (peer,scram-sha-256,md5…) and masks any other value (--auth admin:pwfrom httpie,--basic-auth admin:pw).and,or,to,the,with…) is never masked as a secret flag's value. A quoted one (--password "and") still is.--auth-token …,--auth s3cr3tT0ken,--password hunter2,--token tok9stay masked.Tests:
pii.TestSecretFlagAuthAndStopWords(fails on main, passes here);go test ./...green. GUIDE.md and CHANGELOG (Unreleased) updated.🤖 Generated with Claude Code