osec.one case analysis cover: chalk and debug 2025, a 2FA-reset email from npmjs.help and a crypto clipper in 18 packages

On 8 September 2025 one maintainer, Josh Junon (npm user qix), clicked a two-factor reset email from support@npmjs.help. Within hours, new releases of chalk, debug, ansi-styles, strip-ansi and 14 other packages he publishes carried browser code that rewrote cryptocurrency addresses. Those 18 packages add up to about 2.67 billion downloads a week. The bad versions were public for roughly two hours, and on-chain trackers counted about $500 reaching the attacker.

The tiny theft hides how close this came. Wiz found the malicious code in at least 10% of cloud environments it monitors during that window, and Vercel found 70 teams and 76 projects whose builds pulled a compromised version. This write-up goes step by step: the lure, how a TOTP code got relayed, what the payload did, why it was caught quickly, and the controls that break each step. It differs from the two npm cases we covered before: Ledger Connect Kit 2023 was a former employee's account nobody revoked, and Shai-Hulud was a worm that spread on stolen tokens. Here a careful, long-time maintainer with 2FA turned on got phished in real time.

Six-step diagram: npmjs.help lure, clone page relays password and TOTP to npm, attacker publishes as qix, 18 packages get browser code, clipper swaps payee addresses, removed after about two hours

What happened, dated (UTC)

WhenEventSource
5 Sep 2025npmjs.help registered (one analysis says 4 Sep)Aikido, Varonis
8 Sep, morningEmail from support@npmjs.help: 2FA details are over a year old, update them or the account is locked on 10 Sep 2025Aikido, Varonis, maintainer's posts
8 Sep, about 13:00Account taken over (SEAL put it at about 9:30 AM ET)Security Alliance via LWN, Wiz
8 Sep, 13:16First malicious releases flagged by Aikido's feedAikido
8 Sep, 15:15Maintainer confirms on Bluesky that he was compromised and starts removing versionsAikido
8 Sep, 16:58Second package from the same actors found: proto-tinker-wc@0.1.87Aikido
8 Sep, 17:39Vercel starts incident responseVercel
8 Sep, 22:19Vercel purges build caches for 76 affected projectsVercel
8-9 SepSame lure hits DuckDB's duckdb_admin account: duckdb 1.3.3, @duckdb/node-api 1.3.3, @duckdb/node-bindings 1.3.3, @duckdb/duckdb-wasm 1.29.2DuckDB advisory GHSA-w62p-hx95-gf2c
22 Sep 2025GitHub announces npm changes: TOTP 2FA deprecated for FIDO, 7-day granular tokens, tokens off by default for publishingGitHub blog

The 18 releases and their reach

Weekly downloads as Aikido listed them on the day. Most of these are dependencies of dependencies: hardly anyone installs is-arrayish or color-name on purpose, but nearly every JavaScript build has them somewhere in its tree. Wiz found at least one of the targeted packages in 99% of cloud environments.

PackageMalicious versionWeekly downloads (millions)
ansi-styles6.2.2371.41
debug4.4.2357.60
chalk5.6.1299.99
supports-color10.2.1287.10
strip-ansi7.1.1261.17
ansi-regex6.2.1243.64
wrap-ansi9.0.1197.99
color-convert3.1.1193.50
color-name2.0.1191.71
is-arrayish0.3.373.80
slice-ansi7.1.159.80
error-ex1.3.347.17
color-string2.1.127.48
simple-swizzle0.2.326.26
supports-hyperlinks4.1.119.20
has-ansi6.0.112.10
chalk-template1.1.13.90
backslash0.2.10.26
18 packages2,674.08

What two hours means in installs. If the 2.67 billion weekly downloads were spread evenly across the week, two hours is 2 / 168 = 1.19% of it, or about 31.8 million package downloads served while the bad versions were live. That is an upper bound for how many could have been malicious: a download only got the bad version when it resolved a fresh version inside the range (for example ^5.0.0 picking 5.6.1) instead of reading a lockfile, or when a cache missed. Wiz's 10% of cloud environments and Vercel's 76 projects show that a real share did.

Step 1-3: how 2FA got phished

The lure was ordinary and well built:
1. Lookalike domain. npmjs.help was three days old. .help is a real top-level domain, and "npmjs" is the name people see in every package URL.
2. Plausible reason and a deadline. The email said the account's 2FA details were over a year old and the account would be locked on 10 September unless updated. A 48-hour deadline cuts the time to think.
3. Real-time relay. The link opened a pixel-perfect copy of the npm login. DuckDB's maintainers, hit by the same kit, wrote that the clone forwarded their actions to the real npmjs.com: they logged in, completed 2FA and even reset their 2FA as asked. npm sent the real challenge, the victim typed the real code into the fake page, and the attacker used it at once. A six-digit TOTP code proves you have the authenticator app; it says nothing about which site you typed it into.
4. Persistence. With a live session the attacker created an API token and published from it (DuckDB's account of their own case). A token survives a later password change unless someone revokes it.

Junon's own words on the day: "Sorry everyone, I should have paid more attention. Not like me; have had a stressful week." DuckDB added the most useful detail for defenders: their browser did not autofill the password on the clone, and that "should have been a red flag." A password manager matches the exact domain, so a refused autofill is a free phishing alarm.

Step 4-5: what the payload did

The injected code (Aikido de-obfuscated it from is-arrayish's index.js) only acts in a browser, so it mattered for front-end bundles, not for CLI tools that use chalk to colour terminal output:
- It wraps fetch and XMLHttpRequest, and rewrites JSON and text responses before the page sees them. Any wallet address in a response is swapped.
- It recognises address formats for Ethereum, Bitcoin (legacy and SegWit), Bitcoin Cash, Litecoin, Tron and Solana.
- It picks the replacement from its own list with a Levenshtein (edit-distance) match, so the swapped address looks as much like the real one as possible to someone checking the first and last characters.
- It wraps window.ethereum request, send and sendAsync: in eth_sendTransaction the to address is replaced, and ERC-20 approve, transfer, transferFrom and permit get the attacker as recipient or spender. Solana signing calls are intercepted too.
- It exposes window.stealthProxyControl (isActive, getInterceptCount...) so its operator can check it is running.

Content Security Policy and Subresource Integrity do not help here: the code shipped inside your own bundle, from your own origin, with whatever hash your build gave it. The only places to stop it are before it enters the lockfile or before the build ships.

Why the damage was about $500

FactorEffect
Fast detectionAikido flagged the releases at 13:16 UTC from its feed of new versions; a developer also hit a strange build failure the same morning (Arkham).
Fast owner responseMaintainer public within about two hours, versions removed by npm and the owner the same day.
LockfilesProjects installing with npm ci from a committed lockfile kept the old versions.
Browser-only payloadServer code, CLIs and test runners that import chalk or debug never ran the clipper.
Deploy lagA front-end had to be built, deployed and then used for a crypto payment before the 2-hour window closed and caches were purged.
ResultArkham tracked about $503 at the attacker's address, mostly memecoins, some sent there rather than stolen.

None of these were controls the attacker had to beat. They were luck and speed. The same access with a quieter payload, an install script that steals CI secrets, would have done far more in two hours, which is what Shai-Hulud did a week later.

Controls that break each step

StepControlWho
LureTreat any email asking you to "update 2FA" as phishing; go to npmjs.com by typing it. A refused password-manager autofill means stop.Maintainers
Relay of the codeUse a passkey or security key (WebAuthn) for npm, not TOTP. The browser signs for npmjs.com only, so a clone on npmjs.help gets nothing it can replay. GitHub's 22 Sep plan deprecates TOTP for exactly this reason.Maintainers
TokenPublish from CI with trusted publishing (OIDC, generally available on npm since July 2025) and turn off token publishing for the package. A phished web session then has no token to mint that can publish.Maintainers
PublishRequire 2FA for every publish and keep granular tokens short (GitHub's plan: 7 days).Maintainers, npm
InstallCommit lockfiles and install with npm ci; add a release cooldown (pnpm minimumReleaseAge, Renovate minimumReleaseAge): a 3-day wait would have skipped all 18 versions.Consumers
BuildRebuild front-ends built between 13:00 and about 17:00 UTC on 8 Sep 2025; search lockfiles for the versions in the table above.Consumers

The cooldown point is not a guess: our 3-day release cooldown review checks this case and the other malicious npm and PyPI releases of 2024-2026 against a three-day wait. If your packages publish from GitHub Actions, the workflow risk check flags the workflow patterns that let a pull request reach the publish step, which matters once trusted publishing makes CI the only way to release.

Check your own projects

1. Search every lockfile for the 18 versions above plus the DuckDB four: grep -E '"(chalk|debug|ansi-styles|strip-ansi)"' -A2 package-lock.json or npm ls chalk debug ansi-styles.
2. List builds and deploys from 8 Sep 2025, 13:00-17:00 UTC that ran a fresh install, and rebuild them with a clean cache.
3. If you publish to npm: switch 2FA to a security key or passkey, revoke tokens you do not use, and move publishing to trusted publishing.
4. Set a cooldown of at least 3 days for new versions in pnpm, Renovate or Dependabot settings.

Publishing from GitHub Actions? Check whether a pull request can reach your release workflow, free and without signing in.

Run the workflow risk check

Sources

• Aikido, npm debug and chalk packages compromised (8 Sep 2025): https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised
• Wiz, Widespread npm supply chain attack: breaking down impact and scope across debug, chalk and more: https://www.wiz.io/blog/widespread-npm-supply-chain-attack-breaking-down-impact-scope-across-debug-chalk
• Vercel, Critical npm supply chain attack response, 8 Sep 2025: https://vercel.com/blog/critical-npm-supply-chain-attack-response-september-8-2025
• DuckDB, security advisory GHSA-w62p-hx95-gf2c: https://github.com/duckdb/duckdb-node/security/advisories/GHSA-w62p-hx95-gf2c
• The Register, Dev falls for phishing email (8 Sep 2025): https://www.theregister.com/2025/09/08/dev_falls_for_phishing_email
• Arkham, npm attack: about $500 stolen (9 Sep 2025): https://info.arkm.com/research/npm-attack-hacker-javascript-supply-chain-500-2025
• LWN, npm packages compromised (quotes the Security Alliance timing): https://lwn.net/Articles/1037196
• Varonis, How one email triggered a global npm supply chain crisis: https://www.varonis.com/blog/npm-hijacking
• GitHub, Our plan for a more secure npm supply chain (22 Sep 2025): https://github.blog/security/supply-chain-security/our-plan-for-a-more-secure-npm-supply-chain/