We manage your security to weather the AI storm →

← Resource Hub

The chalk and debug npm Compromise Explained

By Owen Thurm Published 5 min read

The chalk and debug npm Compromise Explained

Quick answer. On September 8, 2025, attackers used a maintainer's phished npm account to publish chalk, debug and at least 16 other packages with code that swapped crypto addresses in browsers. Aikido's malware feed flagged it at 13:16 UTC.

Watch: The chalk and debug npm Compromise Explained 1:41
Video transcript

On September 8, 2025, the chalk and debug npm packages shipped code that tried to redirect crypto payments in browsers. It began with one fake email.

An email from the lookalike domain npmjs dot help asked maintainer Josh Junon to update his two-factor authentication. The attacker took his login and published malicious versions.

Aikido counted 18 packages with more than 2 billion weekly downloads between them.

The code ran only in browsers. It hooked wallet and network calls, swapped in look-alike attacker addresses across six chains, and altered transactions before signing.

Detection was fast. Aikido flagged it at 13:16 UTC, and npm took down all impacted versions that day.

Exposure was narrow. Per Privy's Andrew MacPherson, an app needed a fresh install and lockfile in the attack window, plus a vulnerable dependency. The sources give no loss figure.

Servers and command line tools were not affected. Inspect the browser bundle you shipped, and verify the address your wallet itself shows.

Search your lockfiles for the bad versions. Then, per GitHub's advisory, upgrade, delete node modules, clean caches and rebuild your browser bundles.

An SDK ships its dependencies to every integrator. Guardian's SDK Audit reviews the published artifact, what it hands the wallet, and who can publish.

Read the full article, or talk to Guardian about what your SDK ships to integrators.

The chalk package colors terminal text, and debug prints debug logs. Aikido listed them at about 300 million and 358 million weekly downloads.

Neither has anything to do with crypto. On September 8, 2025, both shipped code that tried to redirect crypto payments in the browser.

BleepingComputer later revised its lede because the attack "is not as impactful as initially thought," its update note says. Here is what the sources confirm.

What Happened

The maintainer, Josh Junon (qix), received an email from support at npmjs[.]help, a lookalike of npm's domain, BleepingComputer reported.

It said accounts with outdated 2FA credentials would be temporarily locked from September 10, 2025. It asked him to update his two-factor authentication.

Junon later wrote on GitHub that it "looked shockingly authentic."

Aikido says the npmjs[.]help domain was registered on September 5, three days before the attack.

The lookalike site sent login details to the attacker, and malicious package versions followed. Other maintainers received the same email, BleepingComputer reported.

The packages

Aikido listed 18 packages with more than 2 billion weekly downloads between them:

PackageMalicious versionWeekly downloads
ansi-styles6.2.2371M
debug4.4.2358M
chalk5.6.1300M
supports-color10.2.1287M
strip-ansi7.1.1261M
ansi-regex6.2.1244M
wrap-ansi9.0.1198M
color-convert3.1.1194M
color-name2.0.1192M
is-arrayish0.3.374M
slice-ansi7.1.160M
error-ex1.3.347M
color-string2.1.127M
simple-swizzle0.2.326M
supports-hyperlinks4.1.119M
has-ansi6.0.112M
chalk-template1.1.13.9M
backslash0.2.10.26M

The maintainer's own list on the debug GitHub issue also names color 5.0.1.

How the Payload Worked

The code ran in the browser, "on the client of a website," as Aikido put it.

GitHub's advisory for debug says local, server and command line environments are not affected. Browser bundles built with the bad version "will need to be rebuilt."

Aikido's analysis of the payload found that it:

  • Wrapped window.ethereum, fetch and XMLHttpRequest, and handled Solana wallet methods.
  • Checked whether a wallet was connected.
  • Scanned requests and responses for wallet addresses.
  • Swapped them for look-alike attacker addresses, using string matching to hide the change.
  • Altered Ethereum and Solana transactions before signing, including recipients and approvals.
  • Covered Ethereum, Bitcoin, Bitcoin Cash, Litecoin, Tron and Solana.

Funds and approvals could be "redirected to attacker-controlled accounts without any obvious signs to the user," Aikido wrote.

Timeline and Impact

Times are UTC on September 8, 2025, unless noted. Junon's times come from his updates on the debug GitHub issue.

WhenWhat happened
About 13:00 to 15:30Window for affected installs, per Privy's Andrew MacPherson (9 to 11:30 a.m. ET)
13:16Aikido's feed alerts on the new releases
15:15Junon says on Bluesky he is cleaning up, per Aikido
19:59Junon posts npm's message: all impacted versions taken down
21:48Junon reports his npm account restored
Sept 15CVE-2025-59144 published for debug 4.4.2

For an app to be affected, MacPherson listed three conditions, BleepingComputer reported:

  • A fresh install between about 9 and 11:30 a.m. ET.
  • A package-lock.json created during that time.
  • Vulnerable packages in direct or transitive dependencies.

Even then, the code "only impacts individuals accessing the compromised applications over the web," BleepingComputer noted.

None of Aikido, BleepingComputer or GitHub's advisories gives a figure for stolen funds.

What It Shows

Any dependency can reach the wallet. Packages for terminal colors and debug logs ended up rewriting transaction recipients in browsers.

A lookalike domain was enough. One convincing email took over an account behind packages with more than 2 billion weekly downloads, by Aikido's count.

Our npm supply chain guide covers phishing-resistant 2FA and trusted publishing.

Lockfiles narrowed the exposure. By MacPherson's conditions, apps built from a lockfile created before the window did not pull the bad versions.

Detection was fast. Aikido's feed alerted at 13:16 UTC, and the maintainer was cleaning up two hours later.

Server checks miss browser code. The payload ran only in browsers, so the shipped bundle is what to inspect and rebuild.

The wallet prompt is the last check. The payload changed transactions before signing, so the address to verify is the one the wallet itself shows.

Other npm incidents in this series: the axios npm attack and the Ledger Connect Kit attack.

How SDK Audit Tests This

Neither chalk nor debug is an SDK. But an SDK ships its dependencies to every integrator.

Guardian's SDK Audit reviews what a library does with a payload and "what one bad release would do," its service page says. Three of its six areas apply:

  • Published artifact: what ships to the registry versus the repo, including install scripts and dependencies.
  • Transaction construction: what the SDK hands the wallet, and whether it matches the requested call.
  • Release control: who can publish, whether 2FA and provenance are enforced, how a bad version gets pulled.

Guardian reviews both the source and the published package. Its page says "the gap between them is where supply-chain risk lives."

The audit covers TypeScript, Python, Rust, Go and JVM client libraries for EVM and Solana. It is scoped by the public surface and the release pipeline.

After release, Managed Security matches new vulnerability disclosures against what you run. Where one reaches you, an engineer confirms the exposure and works with you on the patch.

For the wider offchain scope, read web3 penetration testing explained.

Frequently Asked Questions

Which chalk and debug versions were malicious?

Version 5.6.1 of chalk and 4.4.2 of debug. Aikido listed 16 more, such as ansi-styles 6.2.2, and the maintainer's list adds color 5.0.1. npm took the bad versions down on September 8. The fixed debug release is 4.4.3.

Did it affect servers or command line tools?

No. GitHub's advisory for debug says local, server and command line environments are not affected. Browser bundles built with the bad versions could still carry the malware and need to be rebuilt.

How much was stolen?

No source we read gives a loss figure. BleepingComputer later revised its lede because the attack was not as impactful as first thought.

What should teams check now?

Search lockfiles for the bad versions. Then follow GitHub's advisory: upgrade, delete node_modules, clean package manager caches and rebuild browser bundles. Aikido also advises a lockfile and pinned versions.

Sources

Know what your SDK ships to integrators

Guardian's SDK Audit reviews your published package, its dependencies, the transactions it builds and who can release it.