You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No check exists that a changed package-lock.json (or review-enrichment/package-lock.json, apps/gittensory-ui/package-lock.json) stays internally consistent with its package.json, or that lockfile entries weren't hand-edited to swap a resolved tarball URL/integrity hash for something outside the registry's normal resolution — a classic supply-chain vector. npm ci only catches STRUCTURAL mismatch locally for the person running it; nothing surfaces a maliciously-crafted-but-internally-consistent lockfile edit as a gate finding the way secret_leak does. This is real but speculative — no evidence of exploitation, lower priority than the other findings in this batch.
Requirements
Add an advisory-by-default (block opt-in, matching house style) lockfile_tamper_risk finding: flag any diff hunk inside a package-lock.json/*.lock file where a resolved:/integrity: value changed WITHOUT the corresponding package.json dependency version changing, or where a resolved URL points outside registry.npmjs.org.
Config-driven gate dimension (gate.lockfileIntegrity: off|advisory|block), off by default.
A new gate rule producing a lockfile_tamper_risk finding when the conditions above are met.
The gate.lockfileIntegrity setting wired through the config-as-code chain.
Tests: a legitimate dependency bump (version + resolved + integrity all change together) does not trigger; a hand-edited resolved/integrity with no corresponding version bump does trigger; a resolved URL outside the npm registry triggers.
Acceptance criteria
A tampered lockfile entry (resolved/integrity changed without version bump, or non-registry URL) produces the advisory finding.
A normal npm install-driven lockfile update does not false-positive.
Off by default.
Expected outcome
A previously entirely-silent supply-chain vector (hand-edited lockfile entries) gets a real, if currently low-priority, deterministic gate signal — available to enable for repos with elevated supply-chain concerns.
Parent: #1936
Problem
No check exists that a changed
package-lock.json(orreview-enrichment/package-lock.json,apps/gittensory-ui/package-lock.json) stays internally consistent with itspackage.json, or that lockfile entries weren't hand-edited to swap a resolved tarball URL/integrity hash for something outside the registry's normal resolution — a classic supply-chain vector.npm cionly catches STRUCTURAL mismatch locally for the person running it; nothing surfaces a maliciously-crafted-but-internally-consistent lockfile edit as a gate finding the waysecret_leakdoes. This is real but speculative — no evidence of exploitation, lower priority than the other findings in this batch.Requirements
lockfile_tamper_riskfinding: flag any diff hunk inside apackage-lock.json/*.lockfile where aresolved:/integrity:value changed WITHOUT the correspondingpackage.jsondependency version changing, or where aresolvedURL points outsideregistry.npmjs.org.gate.lockfileIntegrity: off|advisory|block), off by default.Deliverables
lockfile_tamper_riskfinding when the conditions above are met.gate.lockfileIntegritysetting wired through the config-as-code chain.resolved/integritywith no corresponding version bump does trigger; aresolvedURL outside the npm registry triggers.Acceptance criteria
npm install-driven lockfile update does not false-positive.Expected outcome
A previously entirely-silent supply-chain vector (hand-edited lockfile entries) gets a real, if currently low-priority, deterministic gate signal — available to enable for repos with elevated supply-chain concerns.