npm Supply Chain Attack 2025: How 18 Popular Packages Were Compromised

If you’ve ever worked with JavaScript, chances are you’ve used npm packages without even thinking twice. From small utilities to massive frameworks, these open-source libraries are the backbone of modern web development. But what happens when the trust we place in these packages is exploited?

On September 8, 2025, the JavaScript ecosystem faced a major wake-up call: 18 popular npm packages were compromised in a supply chain attack that could potentially affect millions of developers worldwide. In this post, we’ll break down what happened, why it matters, and most importantly, what you can do to protect yourself and your projects.


What Is a Supply Chain Attack?

Before diving into the specifics, let’s understand what a supply chain attack is.

A supply chain attack targets software dependencies, libraries, or tools that developers rely on. Instead of attacking your code directly, hackers compromise the third-party packages you trust. When you install a malicious package, your project becomes vulnerable—often without you realizing it.

In the npm attack, hackers didn’t exploit the projects themselves—they exploited the maintainers’ accounts, which then allowed them to inject malware into widely-used packages.


How the npm Attack Happened

The attack was deceptively simple but effective: a phishing campaign. Hackers impersonated npm’s support team and sent emails from a typosquatted domain, npmjs.help.

The emails instructed maintainers to update their two-factor authentication (2FA) within 48 hours. One maintainer, Josh Junon (npm username: qix), fell for the trap. By entering his credentials and 2FA code on a fake login page, he unwittingly gave the attackers full access to his account.

Once inside, the attackers published malicious versions of 18 npm packages, including some of the most commonly used ones:

The malicious code, known as a crypto-clipper, hijacked cryptocurrency transactions by replacing wallet addresses with those controlled by the attackers. Essentially, developers using these packages could unknowingly have crypto funds stolen.

For more technical coverage, check out Ars Technica and Bleeping Computer.


Why This Matters

You might think, “I’m careful, I update my packages regularly—why should I worry?”

Here’s why:

  1. Dependencies spread risk: Even if your own code is secure, a compromised dependency can infect your project.
  2. Wide reach: These 18 packages alone have over 2 billion weekly downloads, according to Bleeping Computer. Millions of projects rely on them.
  3. Silent attacks: Crypto-clipper malware operates quietly, making it hard to detect until money is already stolen.

How Developers Can Protect Themselves

The attack is a reminder that security is a continuous process. Here are actionable steps every developer can take:

1. Be Wary of Phishing Emails

Phishing remains one of the easiest ways for hackers to gain access.

  • Always verify the sender’s email address
  • Avoid clicking on suspicious links
  • Use official communication channels to confirm security requests

2. Enable Two-Factor Authentication (2FA)

2FA adds an extra layer of security, but it’s not a silver bullet. Attackers can still trick users into revealing codes, so combine 2FA with vigilance.

3. Audit Dependencies Regularly

Regularly check the dependencies in your projects. Tools like these can help:

4. Monitor Your Packages

Keep an eye on package updates, releases, and any unusual activity:

  • Watch repositories on GitHub
  • Subscribe to npm security advisories
  • Use automated alerts for changes in critical dependencies

5. Educate Your Team

Security is a team effort. Make sure everyone involved in development understands:

  • How to spot phishing attempts
  • The importance of auditing dependencies
  • Reporting and responding to suspicious activity

Lessons Learned from the Attack

This incident highlights the risks of relying on third-party code and the importance of open-source community vigilance.

  • Open-source software is not risk-free: Even highly popular packages can be compromised.
  • Trust, but verify: Always double-check your dependencies.
  • Community matters: Quick response from the community helped contain the attack.

It’s also a lesson for maintainers: your accounts are a target, and phishing attacks are increasingly sophisticated. A single compromised account can affect millions of users.


Real-World Example

Imagine you’re developing a Node.js application that relies on chalk for terminal output. You run npm install chalk, unknowingly downloading the malicious version. If your app interacts with cryptocurrency wallets—even indirectly—the crypto-clipper malware could replace addresses in transactions without your knowledge.

This is not hypothetical. Supply chain attacks like this have already affected thousands of projects and highlight the importance of proactive security measures.


Staying Informed

Stay ahead of future attacks by following trusted sources:

Additionally, follow cybersecurity news platforms like Bleeping Computer and Security Boulevard for real-time updates.


Final Thoughts

The npm supply chain attack of 2025 serves as a wake-up call. Open-source software is incredibly powerful, but it comes with risks. Developers, maintainers, and organizations need to remain vigilant.

If you’re using npm packages in your projects, take the time today to:

  • Audit your dependencies
  • Update to secure versions
  • Implement 2FA
  • Educate your team about phishing attacks

Cybersecurity is a shared responsibility. By taking these steps, you can protect your projects and help maintain trust in the open-source ecosystem.

Scroll to Top