DEV Community

Cover image for The Largest NPM Supply Chain Attack of 2025: A Deep Dive into the Compromise of Billions of Downloads
Om Shree
Om Shree

Posted on

The Largest NPM Supply Chain Attack of 2025: A Deep Dive into the Compromise of Billions of Downloads

In the ever-evolving landscape of cybersecurity, supply chain attacks continue to pose one of the most insidious threats to software ecosystems. On September 8, 2025, the Node Package Manager (NPM) registry, a cornerstone of JavaScript development, became the epicenter of what has been described as the largest supply chain attack in its history. This incident compromised 18 popular packages, collectively boasting over 2 billion weekly downloads, and targeted cryptocurrency users by injecting malicious code designed to hijack transactions. While the attack's potential for widespread damage was immense, swift detection and response limited its real-world impact to minimal financial losses. This article explores the attack in detail, from its execution to its aftermath, drawing on insights from security researchers and affected parties.

The Genesis of the Attack: Phishing and Account Compromise

The attack began with a sophisticated social engineering tactic: a phishing email impersonating NPM support. Sent from the domain "npmjs.help" (registered on September 5, 2025), the email tricked the maintainer known as "Qix" (a reputable developer behind several high-profile packages) into resetting their two-factor authentication (2FA). This allowed the attackers to gain control of Qix's NPM account around 13:16 UTC on September 8. Once inside, the perpetrators published malicious updates to 18 packages, embedding harmful code in files like index.js.

This method bypassed traditional security measures by exploiting human trust rather than technical vulnerabilities. The phishing domain was a subtle variation on legitimate NPM communications, highlighting the ongoing challenge of developer identity as an attack vector. The rapid publication of compromised versions—immediately following the account takeover—suggests the attackers had pre-planned their payload and targets.

Affected Packages and Versions: A Billion-Download Blast Radius

The compromised packages were among the most ubiquitous in the JavaScript ecosystem, used in everything from command-line tools to web applications. Here's a comprehensive list of the affected packages and their specific malicious versions, along with their approximate weekly download counts at the time:

Additionally, follow-up investigations revealed more packages tied to the same campaign, including duckdb@1.3.3, @coveops/abi@2.0.1, @duckdb/node-bindings@1.3.3, @duckdb/duckdb-wasm@1.29.2, and @duckdb/node-api@1.3.3. One outlier, proto-tinker-wc@0.1.87, was compromised later that day at 16:58 UTC, likely by the same actors.

These packages are dependencies in countless projects, including major web frameworks and tools. The sheer scale—over 1 billion downloads of the affected versions before remediation—meant the entire JavaScript ecosystem, which powers about 60% of web applications, was potentially at risk.

The Malicious Payload: A Stealthy Crypto Thief

The injected code was obfuscated to evade initial detection but, upon deobfuscation, revealed a browser-based malware focused on cryptocurrency theft. It operated by injecting itself into core browser functions such as fetch, XMLHttpRequest, and wallet APIs (e.g., window.ethereum for MetaMask-like extensions and Solana wallets).

Key behaviors included:

  • Network-Layer Interception: The malware poisoned page content or API payloads before they reached the application, altering data in transit.
  • Wallet-Layer Hooking: It corrupted transactions by modifying provider call arguments just before signing, even if the user interface displayed correct information. This made it particularly dangerous for software wallets.
  • Address Swapping: Using Levenshtein distance algorithms, the code replaced legitimate cryptocurrency addresses with attacker-controlled ones that appeared similar, reducing the chance of user detection during casual reviews.
  • Targeted Chains: Supported multiple blockchains, including Ethereum (ETH), Bitcoin (BTC, bc1...), Tron (TRX, T...), Bitcoin Cash (BCH, bitcoincash:), Litecoin (LTC, ltc1..., L.../M...), and Solana.
  • Stealth Features: The payload avoided obvious red flags, focusing on silent redirection of funds during transactions like approvals (function selectors: 0x095ea7b3, 0xd505accf) or transfers (0xa9059cbb, 0x23b872dd).

Indicators of compromise (IoCs) included:

  • Primary ETH receiver: 0xFc4a4858bafef54D1b1d7697bfb5c52F4c166976
  • Hard-coded address lists for various chains
  • Global patterns: stealthProxyControl, runmask, newdlocal, checkethereumw, neth, loval, rund
  • Constant Solana pubkey: 19111111111111111111111111111111

The malware activated when users visited pages incorporating the compromised packages, making it a client-side threat aimed at Web3 users engaging in DeFi or crypto transactions.

Detection, Response, and Community Mobilization

Detection occurred rapidly thanks to security firms like Aikido, whose intel feed flagged the anomalies at 13:16 UTC on September 8. JFrog and other researchers, including SlowMist, quickly analyzed the payload and shared findings. Ledger's CTO, Charles Guillemet, amplified the alert on X (formerly Twitter), advising users to halt on-chain transactions unless using hardware wallets and to verify every detail before signing.

Qix, the compromised maintainer, acted swiftly to revoke the malicious versions within about two hours, significantly containing the damage. NPM removed most affected packages, though some like simple-swizzle lingered briefly. The open-source community thwarted the attack's full potential, with many projects (e.g., Blockstream Jade, Venus Protocol, Flamingo Finance, Rango Exchange) publicly confirming they were unaffected after audits.

The Impact: A Whimper Instead of a Bang

Despite the hype, the attack's actual harm was negligible. Attackers stole only about $66 in total—roughly 5 cents in Ethereum and $20 in a memecoin—far outweighed by the response costs to organizations. The amateurish obfuscation and quick takedown prevented a Log4j-scale disaster. No major crypto ecosystems reported significant losses, though the incident disrupted development workflows and heightened paranoia among developers.

Lessons Learned and Prevention Strategies

This attack underscores the fragility of open-source supply chains. Key takeaways include:

  • Developer Vigilance: Treat unsolicited emails with suspicion, even from seemingly official sources. Enable multi-factor authentication beyond SMS.
  • Dependency Management: Use package lock files to pin versions, regularly audit dependencies, and employ tools like Aikido SafeChain for pre-install malware checks.
  • User Protections: Hardware wallets (e.g., Ledger) provide a critical layer of defense by allowing transaction verification on a secure device. Always double-check addresses and avoid software wallets for high-value transactions during alerts.
  • Ecosystem Improvements: NPM and similar registries should enhance account security, perhaps with mandatory hardware keys for high-impact maintainers. Broader adoption of software bill of materials (SBOM) and automated scanning can mitigate risks.
  • Redundancy Measures: Developers should maintain offline backups, rotate credentials post-incident, and clear NPM caches before reinstalling packages.

In a post-attack guide shared on X, experts emphasized breaking down prevention into auditing dependencies, using hardware wallets, and avoiding unverified sources.

Conclusion: A Wake-Up Call for Supply Chain Security

The September 2025 NPM attack, while contained, serves as a stark reminder of the interconnected risks in modern software development. With billions of downloads at stake, the incident highlights the need for collective vigilance in the open-source community. As Web3 and DeFi grow, so do the incentives for such attacks—making robust security not just an option, but a necessity. By learning from this near-miss, the ecosystem can build stronger defenses against future threats.

Top comments (2)

Collapse
 
thedeepseeker profile image
Anna kowoski

Indeed Informative!

Collapse
 
om_shree_0709 profile image
Om Shree

Thanks Ma'am Glad you liked it!