Crypto-Stealing Code Slips Into NPM

NPM open source breach

Josh Junon, a software developer and maintainer, revealed on social media this week that his account had been compromised and 18 of his popular JavaScript packages tampered with. The malicious updates injected code designed to steal cryptocurrency from unsuspecting users.

These weren’t obscure libraries. Collectively, the 18 packages are downloaded more than two billion times each week, making this one of the most serious compromises in the history of the Node Package Manager (NPM) ecosystem. The sheer volume highlights how a single breach can ripple outward, reaching developers and enterprises worldwide.

A Breach That Shakes the Ecosystem

Junon disclosed the compromise after detecting unusual behavior in his repositories. Attackers had slipped in code that could drain crypto wallets, potentially affecting not only developers but also downstream applications and services that embedded the tainted packages.

Mike McGuire, Senior Security Solutions Manager at Black Duck, said the incident reflects persistent vulnerabilities in open source. “This latest supply chain attack on NPM packages underscores the persistent vulnerabilities in open source ecosystems, where even highly popular dependencies with billions of weekly downloads can become vectors for sophisticated malware.”

McGuire added that phishing was the initial attack vector—impersonating NPM support to trick the maintainer into giving up access—which shows that even the best technical safeguards can fail without awareness and stronger identity protections like multi-factor authentication.

Why It Matters

The NPM registry is a central hub for JavaScript developers, powering web apps, enterprise software, and consumer services alike. That makes a breach here uniquely dangerous. As Jonathan Gill, CEO of Panaseer, noted, “As a central hub for modern software, nearly every company with an online presence will depend on npm, often without realizing. Any compromise's impact will spread far and wide, making a breach like this seem especially alarming.”

Gill emphasized that organizations can’t control attackers or flaws in third-party code, but they can control what he calls the “inner circle”: infrastructure, privileged access, and security configurations. “Real resilience comes from proof, meaning verifiable data, not checkboxes,” he said.

Malware by Design

The malicious payload wasn’t crude. It operated at multiple layers, tampering with API calls and silently redirecting cryptocurrency transactions without user awareness. McGuire explained this aligns with broader trends his team has tracked: attackers are increasingly exploiting the client side of web applications by abusing the trust developers place in package registries.

Randolph Barr, CISO at Cequence Security, echoed that concern but described the incident as a consumer-side attack with corporate spillover risk. “The malware was purpose-built to hijack Web3 wallet transactions in the browser, so the direct financial losses fall on end users, not enterprise systems. That said, companies that shipped the poisoned packages during the ~2.5-hour compromise window could have unknowingly delivered malware to customers, which creates reputational and compliance exposure.”

Barr explained that the malware hijacked browser APIs such as fetch, XMLHttpRequest, and wallet APIs, rewriting outbound calls—a “classic example of business logic abuse at the API layer.” He warned that the same tactics could target modern MCP connectors and tools, making central oversight and anomaly detection essential.

The Role of Standards and Visibility

The industry has started to recognize that fragmented visibility is one of the biggest challenges in cybersecurity. Initiatives like the Open Cybersecurity Schema Framework (OCSF) are designed to reduce the burden of stitching together data from disparate tools.

While OCSF won’t prevent a malicious package from being published, it helps defenders detect unusual behavior faster by enabling security tools to share and normalize telemetry. Combined with software bills of materials (SBOMs) and automated software composition analysis (SCA), organizations can gain visibility into their dependencies and spot anomalies earlier in the development lifecycle.

McGuire stressed that SCA tools should be embedded directly in CI/CD pipelines, automating SBOM generation and providing real-time intelligence: “By integrating comprehensive risk intelligence—covering vulnerabilities and operational risks—into development workflows, teams can reduce the attack surface and ensure uncompromised trust in software.”

Shared Responsibility

The NPM breach is a reminder that no single group can carry this burden alone. Developers can’t blindly trust every package. Maintainers can’t be expected to serve as global gatekeepers. And enterprises can’t assume their suppliers or vendors have every angle covered.

What’s needed is a model of shared responsibility:

  • Developers vetting dependencies and avoiding blind auto-updates.
  • Enterprises investing in SBOMs, SCA, and runtime monitoring.
  • Vendors and industry groups pushing interoperability through frameworks like OCSF.
  • Regulators and policymakers considering whether critical supply chain practices require oversight.

Looking Ahead

Open source isn’t optional—it’s the backbone of modern software. But the compromise of 18 high-volume NPM packages should be viewed as more than an isolated theft attempt against crypto users. It’s a warning shot.

Today, the malicious payload was designed to empty wallets. Tomorrow, it could be tailored to harvest credentials, plant backdoors, or cripple enterprise systems.

We can’t eliminate every external threat. But we can strengthen what’s inside the perimeter, improve visibility, and move faster when—not if—the next supply chain attack comes.

Author
  • Managing Editor, Security Buzz
    Tony has worked in and written about the technology and cybersecurity sectors for over 20 years. In his role as Managing Editor of Security Buzz, he oversees a staff of journalists helping to keep readers apprised of the latest developments and innovations in the cybersecurity industry.