// Threat and defense
Supply chain security: npm dependencies in 2026
Why the dependency became the entry point
Your SaaS is not just the code you wrote: it is that plus hundreds of npm packages you imported without reading. In 2026 that became one of the biggest vectors. The Shai-Hulud worm, detected in 2025 with a new wave in May 2026 (hitting the TanStack tree via CI cache-poisoning and npm’s OIDC publishing endpoint), is self-propagating: it compromised a maintainer, stole cloud and npm tokens, used those tokens to reach more accounts and published itself into more packages.
The scary part: the worm ran on preinstall, before defenses engaged, and spread through CI/CD, where tokens are plentiful. A compromised transitive dependency becomes theft of your pipeline’s secrets.
Where you are exposed
The risk is not just installing a malicious package; it is what it reaches when it runs.
- Lifecycle scripts (preinstall/postinstall) running with access to your environment.
- CI/CD tokens (npm, cloud, OIDC) within reach of a dependency script.
- An automatic bump that pulls the compromised version the minute it ships.
- A transitive dependency you did not even know you had.
How to reduce the risk
You cannot read every package, but you can shrink the blast radius. Hold the bump for a few days (the window when the community detects the rotten package), disable lifecycle scripts when possible, and treat the CI token as the most valuable target: minimal scope, rotation, and no broad token within reach of a preinstall.
- A bump cooldown (e.g. Dependabot cooldown) catches most compromised packages.
- A pinned lockfile and dependency-change review in the PR.
- A CI token with minimal scope and rotation; short-lived OIDC.
- Consider --ignore-scripts and SCA (Snyk/Dependabot) as continuous hygiene.
Where RET fits
RET does not replace SCA (keep Snyk/Dependabot on for the dependency tree), but covers what the scanner does not see: whether a compromised token in your CI would reach production, whether the secret is isolated, and the blast radius of a bad dependency. AuditMySaaS monitors change continuously so you do not find out late.
Want to know whether this happens in your system?
Manual pentest for web applications, APIs and apps, from R$9,500, with the Sprint run within 7 business days. We refund 50% if we find no flaw.
Frequently asked questions
What was Shai-Hulud?
A self-propagating npm worm, detected in 2025 with a new wave in 2026, that compromised a maintainer, stole cloud and npm tokens, and republished itself into more packages using those tokens. It ran on preinstall and spread through CI/CD, where tokens are plentiful.
How do I protect myself without reading every package?
By shrinking the blast radius: a bump cooldown (holds the new version for days), a pinned lockfile, a CI token with minimal scope and rotation, and disabling lifecycle scripts when possible. It does not eliminate risk, but cuts most cases.
Does SCA (Snyk/Dependabot) solve it?
It helps a lot on the dependency tree (known CVE, rotten version), and you should keep it on. But it does not see the blast radius in your CI or whether a compromised token reaches production; that is application and infra review.
Who runs it at RET?
Gabriel Lima Ferreira, founder and lead pentester, with an authorized scope, focusing on blast radius and secret isolation.
Keep reading
Practical guide
Security checklist for AI-built SaaS
Threat and defense
MCP tool poisoning: how to prevent it
Threat and defense
Prompt injection in code agents
Comparison
Lovable vs Bolt.new: which is more secure?
By tool
Security for apps built with Bolt.new
By city
SaaS security and pentest in Campinas (SP)