Axios npm attack causes JavaScript supply chain chaos


Security teams are grappling with a major supply chain attack on Axios, a popular JavaScript library with over 100 million weekly downloads.

The North Korean state actor Sapphire Sleet compromised the project’s lead maintainer by stealing a long-lived npm access token. This allowed the attackers to publish two poisoned versions of the package that installed a cross-platform remote access trojan built to infect macOS, Windows, and Linux machines.

The malicious code sat live on the npm registry for about three hours. Three hours might not sound long, but in the world of automated CI/CD pipelines, thousands of enterprise apps grabbed the tainted code almost instantly.

This breach exposes a fundamental flaw in how enterprise-scale JavaScript works. With an adoption rate above 62% among developers, JavaScript’s sheer ubiquity makes it a massive target for state-sponsored hackers.

Languages like C++ and Java typically use bulky standard libraries, but JavaScript relies on a sprawling, decentralised web of micro-packages. Developers pull down hundreds of third-party modules just to execute basic functions, implicitly trusting the security habits of overworked open-source maintainers.

How the the Axios npm attack worked

Security researchers at Socket called the group’s method a time-dependent dependency resolution exploit. Just minutes before dropping the tainted Axios updates, the attackers published a malicious secondary dependency named plain-crypto-js (version 4.2.1).

When developers or automated build systems updated Axios, their package managers automatically fetched this new dependency. Of course, plain-crypto-js was completely missing from the official Axios GitHub repo and its release notes. Security teams watching GitHub for anomalous commits saw absolutely nothing.

The payload existed exclusively on the npm registry. By perfectly timing the release, Sapphire Sleet completely bypassed standard peer review, hiding in the blind spot between public version control repositories and actual production distribution channels.

While the immediate response has been frantic, the secondary effects are incredibly difficult to untangle. Axios sits deep inside both front-end UIs and backend Node.js services. Because the trojan works across platforms, an infected macOS developer laptop could hand attackers a bridgehead just as easily as a Linux production server.

Determining exposure requires heavy forensic auditing. IT departments have to track down exactly which apps ran builds during that specific three-hour window. Ephemeral cloud environments make this infinitely harder. If a containerised app was built and deployed during the attack window, it might have already been spun down and replaced. The evidence is destroyed, but the attacker might still maintain persistence via stolen credentials or newly created backdoors.

Worse, Axios is routinely bundled into other third-party SDKs and commercial tools. Enterprise teams might be running the compromised version hidden deep inside nested dependency trees without even realising they consume it.

Reassessing open-source governance and architectures

A single stolen, long-lived access token caused this entire breach. Corporate environments usually lock down access tokens—rotating them constantly and tying them to specific IPs or hardware keys. The open-source world rarely enforces this kind of rigorous administrative control. In this case, one compromised maintainer bypassed billions of dollars in enterprise perimeter security.

Companies can’t dictate the security policies of independent open-source projects, but they can control their internal ingestion processes. Relying on default package manager behaviors that automatically pull the latest patch or minor versions has to stop.

To prevent build systems from blindly downloading new releases, organisations need to:

  • Pin dependencies to verified versions and strictly enforce the use of lockfiles.
  • Implement internal registries to cache approved package versions, ensuring an external registry hack doesn’t immediately poison the internal codebase.
  • Configure software composition analysis tools to block any build that requests an unverified, newly published sub-dependency.

The repeated targeting of the npm registry is actually pushing some technical leaders to rethink their language choices for sensitive backend systems. JavaScript and TypeScript still dominate, but their structural vulnerabilities are driving interest in alternatives.

Go, for example, compiles into a single static binary and leans much less on external micro-packages for standard web features, shrinking the overall surface area for supply chain attacks. It also features default cryptographic verification, guaranteeing a downloaded module is exactly what the author published.

Rust has also seen a massive surge in adoption due to its memory safety, strict compiler, and the highly-regarded Cargo package manager. No ecosystem is immune to threats, but the Rust community’s cultural expectations around dependency auditing offer a different risk proposition for infrastructure development.

Navigating the Axios npm attack’s aftermath

As the dust settles, engineering teams need to prioritise comprehensive validation. Security analysts must verify that the malicious plain-crypto-js package is entirely purged from local caches, CI servers, and developer workstations. Updating to a patched version isn’t enough if the trojan already executed and established lateral progression within the network.

The same tools that enable rapid product iteration are now the most efficient delivery mechanisms for state-sponsored threat actors. Securing the enterprise requires treating open-source dependencies not as trusted components, but as untrusted external inputs requiring rigorous verification, sandboxing, and continuous monitoring.

See also: Google releases Agent Development Kit for Java

Want to learn more about cybersecurity from industry leaders? Check out Cyber Security & Cloud Expo taking place in Amsterdam, California, and London. The comprehensive event is part of TechEx and is co-located with other leading technology events including the AI & Big Data Expo. Click here for more information.

Developer is powered by TechForge Media. Explore other upcoming enterprise technology events and webinars here.