Skip to content

fix(audit): secrets scan skips dependency lockfiles — integrity hashes are not secrets - #2057

Merged
lex00 merged 1 commit into
mainfrom
fix/secrets-skip-lockfiles
Sep 2, 2026
Merged

lex00 merged 1 commit into
mainfrom
fix/secrets-skip-lockfiles

Conversation

@lex00

@lex00 lex00 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The finding

Dogfooding chant audit . --fail-on merge-worthy on INTENTIUS/blacklight after its 0.54.1 bump: 438 merge-worthy findings, all SEC010 high-entropy hits on web/package-lock.json's integrity fields. 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

scanForSecrets skips 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).

isLockfilePath is 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

…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>
@lex00
lex00 merged commit 8985583 into main Sep 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant