A new npm worm is stealing tokens through install scripts. What do you change in your pipelines right now?
AdvancedScenarioSupply Chain Security
Answer
Situation read → Install-time scripts execute with the CI job's privileges and secrets. Reduce what they can reach.
What I'd do →
- Disable lifecycle scripts by default:
npm ci --ignore-scripts(allow explicit exceptions for packages needing builds). - Use short-lived tokens; replace long-lived npm publish tokens with trusted publishing (OIDC).
- Run installs in jobs with no cloud or publish credentials; separate install/build from publish.
- Check lockfile versions against the advisory; pin and add a release-age cooldown.
- Search for the published IoCs in repos and runner logs, then rotate any exposed token.
Why → If scripts cannot reach secrets, a malicious package has little to steal.
Interview tip → Separate "build with untrusted deps" from "publish with trusted credentials".
More on Supply Chain Security
What is an SBOM, and at which point in the pipeline do you generate it?BeginnerA customer asks for an SBOM for your product. What do you give them?BeginnerHow do you sign container images in GitHub Actions without managing private keys?IntermediateYou signed images in CI. How do you make sure the cluster only runs signed images?IntermediateLeadership wants "SLSA compliance". What do you propose?IntermediateWhat is typosquatting and how do you protect developers from it?Beginner