# Did the npm worms touch my live website? Build vs runtime

> Shai-Hulud and ChainDrop run when packages are installed, on build machines. What that means for a live site, what to ask your agency, and what to rotate first.

Canonical: https://red.run.cloud/learn/did-npm-worms-touch-my-live-website · By Timothy Lindblom · Published 2026-11-02 · Updated 2026-11-02

The npm worms ChainDrop and Shai-Hulud run when a package is installed, on a developer laptop or a build server. None of the sources we read say they altered the pages your visitors load. Your live site is at risk through the secrets the build could read, so ask who installs packages for it and what those jobs could access.

| Fact | Detail | Source |
|---|---|---|
| Where it runs | At package install time, through a `preinstall` hook, on developer machines and CI/CD | [Microsoft, 4 Aug 2026](https://www.microsoft.com/en-us/security/blog/2026/08/04/chaindrop-supply-chain-compromise-anatomy-self-propagating-worm/), [Unit 42, 6 Aug 2026](https://unit42.paloaltonetworks.com/chaindrop-npm-worm-analysis/) |
| What it takes | Tokens and keys: npm, GitHub, cloud, Kubernetes, Vault, SSH, and in some reports Stripe, Slack and database strings | [Aikido, 5 Aug 2026](https://www.aikido.dev/blog/keyv-and-friends-compromised-in-npm-supply-chain-attack) |
| Changed visitor-facing code | No primary source we read reports it | checked 24 Oct 2026 |
| Newest related package | tensorlake@0.5.144, live about 1 hour 40 minutes on 8 Oct 2026 | [GitHub advisory](https://github.com/tensorlakeai/tensorlake/security/advisories/GHSA-8g63-53c9-65j2) |
| CISA alert for ChainDrop | None found. The CISA alert linked below is about the 2025 wave | [CISA, 23 Sep 2025](https://www.cisa.gov/news-events/alerts/2025/09/23/widespread-supply-chain-compromise-impacting-npm-ecosystem) |
| Checked | 24 October 2026 | this page |

This page answers one question: build or runtime. The exact malicious versions, the search steps and the rotation order are on the [ChainDrop check page](/learn/chaindrop-shai-hulud-npm-worm-check). The wider picture is in the October 2026 tracker.

## What is the difference between build and runtime?

Build is everything that happens before your site goes live: installing packages, compiling code, bundling files, running tests. It happens on a developer's machine, in a CI service such as GitHub Actions, or in the build step of a host. Runtime is what happens after: a server answering a visitor, or a browser running the files it was sent.

The worm lives in the first half. [StepSecurity](https://www.stepsecurity.io/blog/chaindrop-npm-worm) and [BleepingComputer](https://www.bleepingcomputer.com/news/security/massive-chaindrop-npm-supply-chain-attack-infects-hundreds-of-packages) both describe a `preinstall` script that fires during `npm install`. It does not wait for your code to import the package. [Unit 42](https://unit42.paloaltonetworks.com/chaindrop-npm-worm-analysis/) describes the same install-time behaviour on developer machines and CI pipelines.

<figure class="ln-figure">
<svg viewBox="0 0 720 230" role="img" aria-labelledby="bvr-title" xmlns="http://www.w3.org/2000/svg" font-family="Geist, sans-serif">
<title id="bvr-title">Build side where the worm runs, and the live site side where visitors are served</title>
<rect x="10" y="30" width="420" height="140" rx="14" fill="#FFF1EF" stroke="#EAD3CF"/>
<rect x="450" y="30" width="260" height="140" rx="14" fill="#FFFFFF" stroke="#EAD3CF"/>
<text x="24" y="22" font-size="13" font-weight="600" fill="#B00500">BUILD: where the worm is documented to run</text>
<text x="464" y="22" font-size="13" font-weight="600" fill="#655553">RUNTIME: what visitors get</text>
<rect x="26" y="60" width="110" height="64" rx="10" fill="#C70500"/>
<rect x="160" y="60" width="110" height="64" rx="10" fill="#FFFFFF" stroke="#EAD3CF"/>
<rect x="294" y="60" width="120" height="64" rx="10" fill="#FFFFFF" stroke="#EAD3CF"/>
<rect x="470" y="60" width="220" height="64" rx="10" fill="#FFFFFF" stroke="#EAD3CF"/>
<path d="M138 92h20M272 92h20M416 92h52" stroke="#B00500" stroke-width="2" fill="none"/>
<g font-size="14" font-weight="600" fill="#FFFFFF"><text x="38" y="88">npm install</text></g>
<g font-size="12" fill="#FFFFFF"><text x="38" y="106">worm runs here</text></g>
<g font-size="14" font-weight="600" fill="#1A0F0F"><text x="172" y="88">Compile</text><text x="306" y="88">Deploy</text><text x="482" y="88">Files and server</text></g>
<g font-size="12" fill="#655553"><text x="172" y="106">and bundle</text><text x="306" y="106">to the host</text><text x="482" y="106">answer visitors</text></g>
<text x="26" y="150" font-size="12" fill="#1A0F0F">Readable here: deploy keys, cloud keys, .env, tokens</text>
<text x="10" y="205" font-size="12" fill="#655553">The risk to the live site is what the build side could read, then use.</text>
</svg>
<figcaption>Build and runtime for a typical site. The worm is documented at the first step; a stolen deploy key reaches the last one. Sources: Microsoft, StepSecurity, Unit 42.</figcaption>
</figure>

## Did the worm change the files my visitors receive?

We found no primary source that says so. Microsoft, Wiz, Aikido, Unit 42 and the [Singapore CSA advisory](https://www.csa.gov.sg/alerts-and-advisories/advisories/ad-2026-009/) describe credential theft and self-propagation. At our check on 24 October 2026 none of them reported a compromised package being delivered inside a browser bundle of an affected site, and none reported that visitors were attacked through a customer's pages.

That is an absence in what we could read, and it is not proof for your site. An attacker holding a stolen deploy key can publish whatever they like, so the question that decides it is whether any secret leaked, not whether a package shipped.

## How can the live site still be hurt?

Through the secrets. [Aikido](https://www.aikido.dev/blog/keyv-and-friends-compromised-in-npm-supply-chain-attack) lists GitHub tokens, cloud credentials, Kubernetes and Vault tokens, Stripe and Slack keys, SSH keys and database connection strings. [Microsoft](https://www.microsoft.com/en-us/security/blog/2026/08/04/chaindrop-supply-chain-compromise-anatomy-self-propagating-worm/) adds npm and GitHub tokens, including OIDC tokens. A build needs many of these to deploy, which is why the build is a better target than the site.

Hosting platforms make the build side explicit. [Vercel's docs](https://vercel.com/docs/environment-variables) say environment variables are available to the build step and to functions. [Netlify](https://docs.netlify.com/build/environment-variables/overview/) lets you scope a variable to builds, to functions, or to both.

| Where your code runs | Did the worm's install hook run there? | What to check |
|---|---|---|
| Developer laptop that runs `npm install` | Yes, if an affected version resolved | Lockfile history, `node_modules`, editor config files |
| CI job (GitHub Actions and similar) | Yes, if an install ran with an affected version | Install logs since 4 Aug 2026, every secret the job could read |
| Host build step (Vercel, Netlify and similar) | Yes, if the build installs packages | Build logs, and which variables were scoped to builds |
| Live server that only starts an already built app | No install, so no hook | Whether anything installs at deploy or start |
| Visitor's browser | No install, so no hook | Nothing in the sources says bundles were altered |
| WordPress or other PHP site with no npm step | No | Whether a theme or plugin was compiled by someone using npm |

Table as of 24 October 2026. It reflects what the vendor write-ups document, not a finding about any particular site.

## Which secrets end up in the browser instead?

This is a separate leak, and the build causes it. Next.js [documents](https://nextjs.org/docs/app/guides/environment-variables) that variables prefixed `NEXT_PUBLIC_` are inlined, at build time, into the JavaScript sent to the client. A secret placed in such a variable is published to every visitor. It is worth looking for on the same day, because rotating a key that is still sitting in a bundle changes nothing for an attacker who already copied it.

The free scan looks for API keys and tokens in shipped bundles, and for exposed `.env` files, `.git` folders and readable source maps. The [30-second `.env` and `.git` check](/learn/bots-requesting-env-and-git-30-second-check) covers the manual version.

## Does a clean lockfile mean we were not hit?

No. A lockfile describes a state, and the worm acts at an install moment. [CRACI](https://craci.com/blog/shai-hulud-npm-worm) lists the gaps: `npx` and global installs bypass the lockfile, old branches do not match current CI, restored caches can bring back infected versions, and bot pull requests can bump a version. [Cycode](https://cycode.com/blog/keyv-cacheable-npm-worm-ai-coding-agents/) adds that caret ranges can move a version silently.

`npm ci` helps going forward, and [how lockfiles and pinning fit together](/learn/supply-chain-security-lockfiles-pinning-provenance) is on its own page. The [npm docs](https://docs.npmjs.com/cli/v11/commands/npm-ci) say it needs an existing lockfile, exits with an error on a mismatch and never writes to the lockfile. It cannot tell you what an earlier `npm install` did.

<div class="ln-selftest">
<h3>Am I affected? Where you stand right now</h3>
<p>A scan from outside cannot see your lockfile, your CI logs or the machine that built the site. The answer sits with whoever runs your builds.</p>
<ol>
<li><span class="ln-state ln-state-detected">Detected</span> <strong>A lockfile, install log or <code>node_modules</code> folder for your site names an affected version, or the persistence files are on a build machine.</strong> Treat that machine or runner and every secret it could read as compromised. Follow the order on the <a href="/learn/chaindrop-shai-hulud-npm-worm-check">ChainDrop check page</a>.</li>
<li><span class="ln-state ln-state-unknown">Unknown</span> <strong>You do not build the site yourself, or nobody can produce install logs and lockfile history from 4 August 2026.</strong> This is the common case. Send the question below to whoever builds it.</li>
<li><span class="ln-state ln-state-confirmed">Confirmed by owner evidence</span> <strong>You hold lockfiles from every branch and install logs for the period, and a search of both finds no affected version.</strong> That covers the packages on the published lists only. Repeat it when new package names are published.</li>
</ol>
<p>No scan, ours included, moves you from "unknown" to "confirmed".</p>
</div>

## What should I ask my agency or freelancer?

If someone else builds or deploys your site, the logs are theirs. Send this and keep the reply:

> Between 4 August 2026 and today, did any developer machine, CI job or host build for our site run npm install, npm update or npx? Please send the lockfile history and install logs for that period, say whether any version named in the Singapore CSA advisory AD-2026-009 was resolved, and list every secret those machines and jobs could read, including deploy keys, hosting tokens, cloud keys and payment or email API keys. If you cannot provide logs, please say so.

Who owns which part is often unclear; the [responsibility page](/learn/who-is-responsible-for-patching-my-website) sets out the usual split between owner, agency and host. If the build did leak something, [who carries the liability and which contract clauses matter](/learn/client-website-hacked-who-is-liable-contract-clauses) is the next question for agency clients.

## What do I rotate, and in what order?

Order is part of the fix. [StepSecurity](https://www.stepsecurity.io/blog/chaindrop-npm-worm) says the worm installs a `gh-token-monitor` script that reacts if the stolen GitHub token is revoked. The [GitHub advisory](https://github.com/tensorlakeai/tensorlake/security/advisories/GHSA-8g63-53c9-65j2) for the related tensorlake release lists the same step order: disconnect the machine, remove the monitor service before revoking the token, rotate from a clean machine, audit packages and repositories, then rebuild from a trusted image.

For the live site, rotate in this order of consequence:

- [ ] Anything that can change or publish the site: hosting and deploy tokens, SSH and FTP credentials, CMS admin and API keys.
- [ ] GitHub and npm tokens that can push code or publish packages.
- [ ] Cloud keys and database credentials, then read their access logs from the install time.
- [ ] Payment, email and third-party API keys present in the build environment.
- [ ] Any key found in a shipped bundle, in addition to the above.

To catch a key before it reaches the repository at all, see [Gitleaks versus push protection](/learn/gitleaks-pre-commit-vs-github-push-protection). The generic method is in a [step-by-step guide to rotating leaked secrets](/learn/rotate-secrets-after-a-breach-guide).

## What limits the next incident?

Three settings, each documented by npm. The [npm v12 change](https://github.blog/changelog/2026-07-08-npm-install-time-security-and-gat-bypass2fa-deprecation/) makes dependency install scripts opt-in, which would have stopped a `preinstall` hook by default. The [`min-release-age`](https://docs.npmjs.com/cli/v11/using-npm/config) option installs only versions older than a set number of days, and is unset by default. `ignore-scripts` is false by default. The structural issue behind all of this is covered in [open source single points of failure](/learn/open-source-single-points-of-failure). Signed packages are not a fix on their own, and [what provenance does and does not prove](/learn/npm-provenance-is-it-safe) explains why. The [other secrets and supply chain guides](/learn/topics/secrets-supply-chain) go further.

## What can Red tell me about this?

Very little about the worm, and we prefer to say so. The free scan reads the stack your site serves and matches each version to known vulnerabilities. It is a lookup, and it cannot see how the site was built. Its useful part here is the outside view after rotation: whether a key or token is still present in something the site serves.

## Questions people ask

### Did Shai-Hulud affect my website?

The worm runs when packages are installed, on developer machines and build servers. None of the vendor or government sources we read says it changed the files your visitors receive. Your site is exposed through the secrets the build could read, such as deploy keys and API keys, so ask who installs packages for it.

### ChainDrop: am I affected if my site is only static HTML and a theme?

Only if a build tool, plugin or developer machine for that site installed an affected npm package. Plain files edited by hand and uploaded over FTP never ran npm. If an agency compiles CSS or JavaScript for you, the install happened on their machine or their pipeline, and that is where to look.

### My host runs Node. Is the live server the thing that got infected?

Starting a Node server does not run the install hook. The hook fires when npm installs a package. If your host runs an install during deploy or at start, that step counts as a build and its logs matter. A host that only starts an already built app did not execute it.

### Is my site hacked if the lockfile has no bad versions?

An old lockfile cannot say what ran in the past. Installs with npx, global installs, restored caches and bot pull requests can resolve other versions. Check the lockfile history and the CI install logs from 4 August 2026, and ask for them in writing.

### What should I rotate first if a build machine installed an affected package?

Remove the worm's persistence first, because revoking a stolen GitHub token before that can trigger it. Then, from a different machine, rotate npm and GitHub tokens, cloud keys, deploy keys, and everything in the environment of that build. Start with whatever can change or publish the live site.

### Can a website scan tell me if I was hit by the npm worm?

No. A scan from outside cannot see your lockfile, your CI logs or the machine that built the site. It can check whether a key or token is sitting in a bundle your site serves, which is useful after a rotation.


## Sources

1. [Microsoft Security: ChainDrop supply chain compromise, anatomy of a self-propagating worm (4 August 2026)](https://www.microsoft.com/en-us/security/blog/2026/08/04/chaindrop-supply-chain-compromise-anatomy-self-propagating-worm/): Install-time execution on developer workstations and CI/CD, and the credentials it targets. Checked 24 October 2026.
2. [StepSecurity: ChainDrop npm worm (4 August 2026)](https://www.stepsecurity.io/blog/chaindrop-npm-worm): Timeline, the preinstall hook, the token monitor and the cleanup order.
3. [Palo Alto Networks Unit 42: ChainDrop, inside a self-propagating npm worm (6 August 2026)](https://unit42.paloaltonetworks.com/chaindrop-npm-worm-analysis/): Install-time behaviour on developer machines and CI pipelines.
4. [Wiz Research: keyv and cacheable npm supply chain attack (4 August 2026)](https://www.wiz.io/blog/keyv-and-cacheable-npm-supply-chain-attack)
5. [Aikido: keyv and friends compromised in npm supply chain attack (updated 5 August 2026)](https://www.aikido.dev/blog/keyv-and-friends-compromised-in-npm-supply-chain-attack): Credential list including Stripe, Slack and database connection strings.
6. [Cyber Security Agency of Singapore: advisory AD-2026-009 (6 August 2026, page updated 2 November 2026)](https://www.csa.gov.sg/alerts-and-advisories/advisories/ad-2026-009/): Government advisory. Describes the compromise and affected versions; at our 2 November 2026 read it still reports no altered production sites.
7. [GitHub Security Advisory GHSA-8g63-53c9-65j2: malicious tensorlake@0.5.144 on npm (8 October 2026)](https://github.com/tensorlakeai/tensorlake/security/advisories/GHSA-8g63-53c9-65j2): Newest confirmed package in the family and a cleanup order.
8. [Cycode: keyv and cacheable npm worm and AI coding agents](https://cycode.com/blog/keyv-cacheable-npm-worm-ai-coding-agents/): Vendor blog. Editor and agent config files as a second trigger.
9. [CRACI: Shai-Hulud npm worm (1 October 2026)](https://craci.com/blog/shai-hulud-npm-worm): Vendor blog. Where a lockfile search misses installs.
10. [Socket: tensorlake npm SDK compromised (8 October 2026)](https://www.socket.dev/blog/tensorlake-compromise)
11. [Next.js docs: environment variables](https://nextjs.org/docs/app/guides/environment-variables): NEXT_PUBLIC_ values are inlined into the browser bundle at build time. Page showed an update on 25 August 2026.
12. [Vercel docs: environment variables](https://vercel.com/docs/environment-variables): Variables are available to the build step and to functions. Page showed an update on 17 September 2026.
13. [Netlify docs: environment variables overview](https://docs.netlify.com/build/environment-variables/overview/): Variables are scoped to builds, functions, or both.
14. [npm docs: npm ci](https://docs.npmjs.com/cli/v11/commands/npm-ci)
15. [npm docs: config (min-release-age, ignore-scripts)](https://docs.npmjs.com/cli/v11/using-npm/config)
16. [GitHub Changelog: npm install-time security and token deprecation (8 July 2026)](https://github.blog/changelog/2026-07-08-npm-install-time-security-and-gat-bypass2fa-deprecation/): Dependency install scripts become opt-in in npm v12.
17. [CISA alert: widespread supply chain compromise impacting the npm ecosystem (23 September 2025)](https://www.cisa.gov/news-events/alerts/2025/09/23/widespread-supply-chain-compromise-impacting-npm-ecosystem): About the first Shai-Hulud wave in 2025. We found no CISA alert specific to ChainDrop at our 24 October 2026 check.
