Skip to content
Lacambra Web Portal Services
← 2026, week by week
Software · Week 14, 30 March to 5 April 2026

The axios npm hijack, and why lockfiles held

On 31 March two axios releases on npm, pushed from a hijacked account, carried a remote-access trojan for about three hours. Who on your side would notice?

An open wooden crate of identical brown-paper parcels tied with string, with one smaller untied parcel in oxblood paper tucked among them.

On 31 March an attacker published two poisoned versions of axios to npm, the public registry that JavaScript projects install their packages from. Google describes axios as the most popular JavaScript library for making web requests, downloaded more than 100 million times a week. Version 1.14.1 went up at 00:21 UTC and 0.30.4 at about 01:00, and both were removed at about 03:15: in Manila, a Tuesday morning from 8:21 to 11:15. Installing either one could plant a remote-access trojan on Windows, macOS or Linux. Projects already pinned to a clean version that ran no fresh install in those hours were fine, the maintainer wrote afterwards, and that difference is the lesson.

How a trusted package turned

The attacker never touched the library's code. They took over the lead maintainer's npm account, and his post-mortem of 2 April says they reached it through his own computer, by a targeted social engineering campaign begun about two weeks earlier, and malware on the machine. The only change to the package was one new dependency, plain-crypto-js, which axios itself never used. Installing axios installed it, and its install script fetched and ran the trojan. Google's Threat Intelligence Group attributed the attack to UNC1069, a financially motivated group it links to North Korea.

There were signals for anyone watching. Genuine releases, as Tenable pointed out, carried a trusted-publisher record tying them to the project's GitHub workflow and to the commit they came from. These were published with a long-lived access token and carried none. The maintainer's own conclusion is blunter: there was no automated way to detect an unauthorised publish, and detection depended entirely on the community noticing. When people opened issues on the project to report it, the attacker deleted them with the hijacked account.

Who on your side can tell what changed

React and Node are part of the stack I build with, and every project in that stack installs its packages from npm. The protection is ordinary. A lockfile, npm's package-lock.json, records the exact version of every package installed, including the dependencies nobody chose by name, so that every later install produces the same tree. A build that installs from it with npm ci gets what was tested, and stops with an error if the lockfile and the project disagree, instead of quietly updating. When someone does update, the change to the lockfile is a list of exactly what moved, there to be read in review.

A lockfile stops surprise upgrades, but an upgrade someone runs on purpose is only as safe as the review of its changes, and here the warning sign would have been a single new package in a long list. If your systems are built for you, someone on your side, or someone you trust who is not the builder, should be able to say what changed in each release and why. If your organisation has developers and this is new to them, it is the kind of work Guide it is for.

Five checks for whoever runs your builds

  • Is the lockfile committed, and does every build and deployment install from it exactly?
  • Does anything install the latest version of a package automatically? Google's advice after this attack was to make sure builds were not pulling "latest" before redeploying.
  • Is there a waiting period before a new release is adopted? npm's min-release-age setting installs only versions published more than a set number of days earlier. It holds back urgent fixes too, so someone has to own the exceptions.
  • Who reads the lockfile changes in each update, and would they notice a package nobody asked for?
  • Where do the deployment secrets live, and could you rotate all of them in an afternoon? GitHub's advisory told anyone who had installed the bad versions to rotate every secret on that machine, from a different computer.

A supply chain like this one runs on trust in people you will never meet, so the least an office can do is make sure someone on its own side is checking. The fit check is a quick way to find out who that should be.

Sources

  1. axios project, GitHub, Post Mortem: axios npm supply chain compromise, 2 April 2026
  2. GitHub Advisory Database, Malware in axios, 31 March 2026
  3. Google Threat Intelligence Group, North Korea-Nexus Threat Actor Compromises Widely Used Axios NPM Package in Supply Chain Attack, 1 April 2026
  4. Tenable, Frequently Asked Questions About the Axios npm Supply Chain Attack by North Korea-Nexus Threat Actor UNC1069, 1 April 2026
  5. npm Docs, package-lock.json
  6. npm Docs, npm-ci
  7. npm Docs, Config

Enrique Lacambra III builds internal business systems from Cainta, Rizal.

Email me← All writing

Tell me what is broken and I will tell you if it is worth building. A 20-minute call, no charge, and I will say so if you do not need me.