Crypto Wallets Emptied in Massive NPM Supply Chain Attack

A devastating software supply chain attack has rocked the developer community after a hacker successfully hijacked the account of a prominent software maintainer through a simple phishing scam. The breach led to malicious code being injected into dozens of popular packages on the npm registry, a massive code library used by JavaScript developers worldwide. These compromised packages, which together are downloaded over 2 billion times per week, contained malware designed to silently steal cryptocurrency from unsuspecting users.

A Simple Mistake, Catastrophic Results

The breach began when Josh Junon, a respected developer known online as “Qix,” fell victim to a cleverly designed phishing email. The message, which appeared to be an official alert from npm support, warned him that he needed to update his two-factor authentication (2FA) settings before a fast-approaching deadline. The email contained a link that directed him to a fraudulent login page, a perfect replica of the real npm site.

There, Junon entered his username, password, and the temporary 2FA code from his authenticator app. Unbeknownst to him, the fake site was a trap. The attackers captured his credentials in real-time and immediately used them to access his account, granting them control over all the software packages he helps maintain. With this access, they swiftly published new, tainted versions of the code to the public registry.

In a public message following the incident, a remorseful Junon took full responsibility. “Sorry everyone, I should have paid more attention,” he stated. “Not like me; have had a stressful week. Will work to get this cleaned up.” His message highlights the human element in cybersecurity and how even a momentary lapse in judgment can have far-reaching consequences.

How the Malware Steals Your Crypto

An analysis of the malicious code reveals a devious and targeted goal: cryptocurrency theft. The malware was specifically designed to operate within a user’s web browser. It activates when a person visits a website or uses an application that includes one of the compromised packages. The code doesn’t target the developers themselves but rather the end-users of the software they create.

Once active, the payload acts as a digital pickpocket. It secretly monitors the user’s internet activity, specifically looking for functions related to cryptocurrency wallets and transactions. It hooks into common browser tools like window.fetch and XMLHttpRequest, essentially listening in on the data being sent and received.

When the malware detects a user trying to send cryptocurrency, it springs into action. It intercepts the transaction request and swaps the recipient’s wallet address with an address controlled by the hackers. To avoid suspicion, the attacker’s address is often computationally selected to look very similar to the intended one, a trick that can easily fool a user who gives it only a quick glance. This means that anyone using a web-based crypto wallet on an affected site could have their funds diverted directly to the thieves without ever knowing what happened.

The compromised packages include some of the most widely used tools in web development, such as chalk, ansi-styles, debug, and strip-ansi, alongside nearly twenty others.

The Attack Spreads to More Developers

The security nightmare didn’t end with Junon’s account. Further investigation revealed that the same attackers managed to compromise another high-profile maintainer account, duckdb_admin. Using the same tactics, the hackers pushed the same wallet-draining malware into another set of popular packages.

This second wave of the attack compromised the duckdb data management tool and its related packages, including @duckdb/duckdb-wasm and @duckdb/node-api. It also hit widely used advertising technology packages like prebid and prebid-universal-creative, dramatically expanding the potential pool of victims. The spread of the attack underscores the cascading effect of a single compromised account in the interconnected world of open-source software.

A Growing Epidemic in Software Development

This incident is a stark reminder of the fragility of the software supply chain. Open-source registries like npm are built on a foundation of trust, but threat actors are increasingly exploiting that trust. Ilkka Turunen, a Field CTO at Sonatype, noted that this attack follows a classic and now well-established pattern.

“By taking over popular open source packages, adversaries can steal secrets, leave behind backdoors and infiltrate organizations,” Turunen explained. “It was not a random choice to target the developer of these packages. Package takeovers are now a standard tactic… because they know they can reach a large amount of the world’s developer population by infiltrating a single under-resourced project.”

According to a recent industry report, npm has become a primary target for crypto-related malware campaigns. This attack method is highly effective because a single compromised package can be automatically downloaded and integrated into thousands of different corporate and personal projects, creating a massive ripple effect. This event serves as a critical wake-up call for developers and organizations to implement stricter security measures, verify their software dependencies, and remain eternally vigilant against increasingly sophisticated social engineering attacks.

Privacy Preference Center