Repository navigation
fix(audit): secrets scan skips dependency lockfiles — integrity hashes are not secrets - #2057
Merged
Merged
Conversation
…s are not secrets Found dogfooding at --fail-on merge-worthy: one web/package-lock.json produced 438 merge-worthy SEC010 findings, every one a sha512 integrity field read as a high-entropy "possible secret". Integrity hashes are public by construction, a credential does not live in a machine-written lockfile, and no other scanner reads them — so the scan now skips the lockfile set (npm/yarn/pnpm/bun/deno/cargo/poetry/uv/pip/composer/ bundler/go/nix) entirely. Per-file skipping, not entropy tuning, keeps the rule explainable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
11 of 13 tasks
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.
The finding
Dogfooding
chant audit . --fail-on merge-worthyon INTENTIUS/blacklight after its 0.54.1 bump: 438 merge-worthy findings, all SEC010 high-entropy hits onweb/package-lock.json'sintegrityfields. Every JS repo with a committed lockfile fails the same way — sha512 integrity hashes are indistinguishable from "possible secrets" by entropy, and they are wall-to-wall in a lockfile.Fix
scanForSecretsskips dependency lockfiles entirely (package-lock.json,npm-shrinkwrap.json,yarn.lock,pnpm-lock.yaml,bun.lock,deno.lock,Cargo.lock,poetry.lock,uv.lock,Pipfile.lock,composer.lock,Gemfile.lock,go.sum,flake.lock), by basename at any depth. Rationale in the doc block: integrity hashes are public by construction, a credential does not live in a machine-written lockfile, and no other scanner reads them. Deliberately per-file rather than entropy tuning — the rule stays explainable, and a real credential pasted into a lockfile is not a plausible enough event to trade the noise for (tested and documented: the skip is total).isLockfilePathis exported for reuse.Tests
Six lockfile shapes silent (including nested
web/package-lock.json— the dogfooded case), same content in a non-lockfile still fires, credential-in-lockfile documented-silent. Full secrets + CLI audit suites (83) green; repo typecheck no regressions.🤖 Generated with Claude Code