138% more reported CVEs per day in 2026 than last year.New: always-on Fixboxes. Vulnerable dependencies, fixed and verified.
← All vulnerabilities

chalk and debug npm compromise: the phished maintainer and how to check whether your builds are affected

On 8 September 2025, an attacker who had phished the npm account of Josh Junon (Qix), the maintainer of debug and many of chalk's building blocks, published malicious versions of 19 packages in eight minutes, between 13:12 and 13:20 UTC. Together they had more than 2 billion downloads a week. The added code ran in browsers, not at install: it hooked network calls and wallet APIs and rewrote cryptocurrency transactions to send funds to the attacker. npm removed the versions the same day. If any build installed one of them and bundled it into JavaScript served to browsers, rebuild and redeploy that bundle.

It is often lumped together with Shai-Hulud, which began a week later. The two are different attacks. This one was a single account takeover with a browser payload that didn't spread and didn't touch CI secrets; Shai-Hulud was a worm that ran at install, stole credentials from developer machines and CI, and used them to infect more packages. Both are software supply chain attacks on npm, and both start with a maintainer's stolen publishing rights.

What happened

Time (UTC)EventSource
5 September 2025The phishing domain npmjs.help is registeredAikido
8 September, before 13:12The maintainer receives a phishing email from [email protected] asking him to update his two-factor authenticationTracking issue
8 September, 13:12–13:20Malicious versions of 19 packages are published, starting with [email protected] and [email protected]npm registry
8 September, 13:16Aikido's feed flags the first packagesAikido
8 September, 13:35A user opens an issue on debug: "Version 4.4.2 published to npm is compromised"Tracking issue
8 September, 15:15The maintainer says he knows he was compromised and starts cleaning upAikido
8 SeptemberClean releases of the chalk organization's packages, such as [email protected], are published over the malicious ones; npm removes all malicious versions over the course of the daynpm registry, GHSA-4x49-vf9v-38px
9 SeptemberDuckDB reports that malicious versions of its npm packages were published in the same waveGHSA-w62p-hx95-gf2c
13 SeptemberThe maintainer publishes clean patch versions of his packages, such as [email protected], to flush caches and mirrorsTracking issue
15 SeptemberThe maintainer publishes advisories with nine CVEs, CVE-2025-59140 to CVE-2025-59331Tracking issue
15 SeptemberShai-Hulud, a separate attack, begins with @ctrl/tinycolorShai-Hulud

The maintainer kept a timestamped log of the response in the debug tracking issue. He notes that GitHub "was not compromised" and that the repositories were untouched: the malicious code existed only in the versions published to npm.

Who is affected

Every project that installed one of the 19 versions while it was on the registry, which was a few hours on 8 September 2025. These packages sit deep in the dependency tree of almost every JavaScript project, so the question isn't whether you depend on them but whether a fresh install resolved to an affected version during that window. Most projects get them as transitive dependencies.

What the malware could do depends on where the code ran. GitHub's advisory for debug is precise: "Local environments, server environments, command line applications, etc. are not affected. If the package was used in a browser context (e.g. a direct <script> inclusion, or via a bundling tool such as Babel, Rollup, Vite, Next.js, etc.) there is a chance the malware still exists and such bundles will need to be rebuilt."

So for most teams the exposure is in their builds: a frontend build that bundled an affected version produced JavaScript that carried the payload to every user who loaded it, for as long as that bundle stayed deployed.

How it works

  • Account takeover by phishing. The attacker sent the maintainer an email from npmjs.help, a lookalike of npmjs.com, asking him to update his two-factor authentication, and the email led to the takeover of his npm account. No vulnerability in npm or GitHub was involved.
  • Code added to the published package only. Each malicious version was "functionally identical to the previous patch version, but with a malware payload added," in GitHub's words. There was no install script: the code sat in the package's own JavaScript and ran when that code was loaded.
  • A browser-only payload. According to Aikido's analysis, the code ran in the browser, where it hooked fetch, XMLHttpRequest and wallet interfaces such as window.ethereum, scanned responses and transactions for addresses on Ethereum, Bitcoin, Solana, Tron, Litecoin and Bitcoin Cash, and replaced them with attacker addresses chosen to look similar.

The CVE records and GitHub's advisories classify it as embedded malicious code (CWE-506). GitHub, as the CNA, scores the nine CVEs 8.8 under CVSS 4.0.

How to check whether you are affected

  1. Search every lockfile on every branch that ran CI on 8 September 2025 for the 19 versions. Put them in affected.txt, one name@version per line (the list is in the box above), and run:
git fetch --all --quiet
for ref in $(git for-each-ref --format='%(refname:short)' refs/remotes); do
  while read -r pkg; do
    name=${pkg%@*}; version=${pkg##*@}
    git grep -n -A3 -F "\"$name\"" "$ref" -- '*package-lock.json' '*yarn.lock' '*pnpm-lock.yaml' \
      | grep -F "$version" | sed "s|^|$pkg  |"
  done < affected.txt
done
  1. Check the builds of that day. Find every frontend build on 8 September 2025 that ran a fresh install (npm install, npm update, a dependency update pull request or a build without a lockfile), and the bundles it produced.
  2. Check what is deployed. A bundle built that day may still be served from a CDN, an app store build or a customer's installation. Check the build dates of the artifacts that are live, not only of the latest release.
  3. Check registry mirrors and caches. The maintainer warned that people were "still affected by malware due to private registry caches" days later. Search Artifactory, Nexus, Verdaccio or other proxies for the 19 versions.

npm audit reports the versions that have advisories. A clean npm audit today doesn't cover a bundle built on 8 September from a lockfile that has since changed. See are we affected? how to assess a new CVE across your builds and what npm audit does and doesn't check.

How to fix it, and what to do if you can't patch yet

  1. Move to any other version. The clean releases published over the malicious ones, such as [email protected] and [email protected], are identical to the last good versions. Pin with overrides (npm) or resolutions (Yarn) if a dependency still resolves to an affected version.
  2. Clear caches and reinstall. GitHub's advisory says to "completely remove their node_modules directory, clean their package manager's global cache, and rebuild any browser bundles from scratch":
rm -rf node_modules
npm cache clean --force
gh cache delete --all --repo ORG/REPO   # GitHub Actions caches, per repository
  1. Rebuild and redeploy every browser bundle built from an affected version, and invalidate CDN caches that serve it.
  2. Purge the versions from registry mirrors and dependency proxies.

Because the payload ran only in browsers, the advisories don't call for rotating CI secrets for this attack. That is the main difference in the response from Shai-Hulud, where any job that installed an infected version must be treated as compromised.

Verify the fix

  1. No lockfile on any branch resolves to one of the 19 versions.
  2. No deployed bundle was built from an affected version: compare each live bundle's build date and lockfile with the list.
  3. Mirrors and caches no longer serve the versions.
  4. The next build is clean. Check the versions it actually installed, from its log or per-build SBOM.

Check for compromise

The indicators for this attack are the package versions themselves; any of the 19 in a build that produced browser code means that code carried the payload. For users of an affected web application, the risk was a cryptocurrency transaction sent to an address that looked like the intended one. If your product handles cryptocurrency in the browser and served an affected bundle, review transactions made through it during the time it was live.

For maintainers and publishers, the indicator to watch is the phishing domain: emails from npmjs.help, or any domain other than npmjs.com, asking you to update two-factor authentication.

What to tell your customers

If you ship a web application or a product with a JavaScript frontend, customers will ask:

We checked every build of [product] from 8 September 2025 for the 19 npm package versions compromised that day, including debug 4.4.2 and chalk 5.6.1. [No build used an affected version.] / [A build of [component] on [date] included [package@version]; we rebuilt it on [date] and the affected bundle was live from [time] to [time].] The malicious code targeted cryptocurrency transactions in the browser and did not run on our servers or in our build systems.

For a first holding statement and templates for each outcome, see how to answer customers after a supply chain attack.

How CRACI helps

CRACI runs your GitHub Actions jobs on its own runners (runs-on: craci) and records every package each job actually fetches from npm, including transitive and hidden dependencies that lockfile-based tools miss. Build history keeps every past build with its SBOM, so you can see which builds contained an affected version and the period you were exposed, within your retention period (180 days by default). For this attack, that answers the question that matters: which frontend builds bundled an affected version.

Nine of the compromised versions have published CVEs, so CRACI flags them like any other vulnerability, and policy gates can block builds that contain them. chalk and the other chalk-organization packages have GitHub malware advisories without a CVE. CRACI doesn't detect malicious packages by behavior or reputation, and doesn't flag a new malicious version before an advisory exists.

CRACI's egress policy, which limits where a job can connect and fails closed, blocks exfiltration from a build to hosts it doesn't need. It doesn't help against this payload, which ran in your users' browsers, not in the build.

See the package record of one of your own builds

Related incidents: Shai-Hulud, the axios npm compromise. Other incidents: all vulnerabilities.

Sources and updates

Primary sources:

Research:

Updates:

  • 2026-11-16: First published.

Frequently asked questions

Which packages were compromised in the chalk and debug attack?

19 packages, each in one version: ansi-regex 6.2.1, ansi-styles 6.2.2, backslash 0.2.1, chalk 5.6.1, chalk-template 1.1.1, color 5.0.1, color-convert 3.1.1, color-name 2.0.1, color-string 2.1.1, debug 4.4.2, error-ex 1.3.3, has-ansi 6.0.1, is-arrayish 0.3.3, simple-swizzle 0.2.3, slice-ansi 7.1.1, strip-ansi 7.1.1, supports-color 10.2.1, supports-hyperlinks 4.1.1 and wrap-ansi 9.0.1. All were published between 13:12 and 13:20 UTC on 8 September 2025.

Does the malware run in Node.js or in CI?

No. According to the advisories, the code only ran in browsers: it rewrote cryptocurrency transactions and wallet addresses in web pages. Local environments, servers and command-line tools were not affected. The risk for a build is that it bundled an affected version into JavaScript served to browsers, so those bundles must be rebuilt.

Is this the same as Shai-Hulud?

No. Shai-Hulud started a week later, on 15 September 2025, and was a different attack: a worm that ran at install time, stole npm, GitHub and cloud credentials from developer machines and CI, and used them to infect more packages. The chalk and debug versions had no install script, did not spread and did not steal secrets.

Do the compromised packages have CVEs?

Nine of them do. The maintainer published CVE-2025-59140 to CVE-2025-59145, CVE-2025-59162, CVE-2025-59330 and CVE-2025-59331 for backslash, simple-swizzle, color-string, color, debug, color-name, color-convert, error-ex and is-arrayish, each scored 8.8 under CVSS 4.0 by GitHub as the CNA. chalk and the other packages from the chalk organization have GitHub malware advisories without a CVE.

How did the attacker get access?

Through a phishing email that asked the maintainer to update his two-factor authentication, sent from the lookalike domain npmjs.help, which had been registered three days earlier. GitHub itself was not compromised, and the source repositories were untouched.

Which versions are safe?

Any version other than the 19 listed. npm removed the malicious versions on 8 September, and the maintainers published new patch versions, identical to the last clean ones, between 8 and 15 September 2025 so that caches and mirrors pick up a clean release, for example debug 4.4.3 and chalk 5.6.2.