Repository navigation
Stop the secrets check flagging JavaScript template-literal keys built from variables and short words (#4287) - #4309
atharva081106 wants to merge 1 commit into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Thanks @atharva081106. This fixes #4287, which was already on our list. Because it changes what the secrets check lets through, it will get a careful security read, and it lands after our tooling freeze ends on November 21. We'll bring it onto current main ourselves and credit you. |
|
Thank you, @atharva081106. We rebuilt this on current main in #4457 (e1cfcea), including a template-literal exemption, then removed that part after a second-model security audit. Exempting a template by its fixed text's entropy let random hex secrets and encoded literals in slots through, so template keys stay reported for now and are documented as a known limit. The other fixes from #4289 landed. We're leaving this PR open for the maintainers to decide on. |
|
Closing this with thanks. Correcting my last note: in the cross-model audit, the template-key exemption let random secrets through, so template keys stay a documented known limit in docs/pregate.md. #4287 stays open to track it. |
Fixes #4287.
Summary
env.kvwhen they contain${...}interpolations, benign static chunks, no secret literals inside interpolations, and no trailing secret literals on the line.sk-/AKIA, high-entropy static text or split secrets, literals inside${...}, non-JS/TS files, block comments, and unclosed multiline templates).Tests
bun test test/redact-engine.test.ts test/redact-pattern-lint.test.ts test/redact-env-kv-attribute-reference.test.ts test/redact-hostname-property-read.test.ts test/redact-context-exemptions.test.ts(520 pass, 0 fail)bun run typecheck&bun run typecheck:test(pass)