logoalt Hacker News

Axios compromised on NPM – Malicious versions drop remote access trojan

1726 pointsby mtudtoday at 2:54 AM698 commentsview on HN

Comments

malikoliviertoday at 1:46 PM

This is exactly to avoid this kind of issue that I decided to work on StableBuild. StableBuild pins and hosts a copy of your dependencies at a specific freeze date, so that your supply chain is never contaminated. This way, a compromised version published after your freeze date (even with the same version number!) would never reach your build.

OsrsNeedsf2Ptoday at 4:51 PM

Updating my packages feels like playing Russian Roulette

Willish42today at 5:13 PM

> This was not opportunistic. It was precision. The malicious dependency was staged 18 hours in advance.

Another obvious ChatGPT-ism. The fact that people are using AI to write these security posts doesn't surprise me, but the fact they use it to write a verbose article with spicy little snippets that LLMs seem to prefer does make it really hard to appreciate anything other than the simple facts in the article.

Yet another case in point for "do your own writing" (https://news.ycombinator.com/item?id=47573519)

flerchintoday at 4:16 PM

Ok it's bad, but our npm projects are pinned in the package-lock.json, which I imagine most would be? So who would pull this besides security scanners?

show 1 reply
jruohonentoday at 8:20 AM

So the root cause was again a developer's opsec. For improving things, I haven't seen many new initiatives on that side (beyond 2FA, but even that seems unenforced in these repositories, I reckon).

OlivOnTechtoday at 6:53 AM

The attacker went through the hassle to compromise a very widely used package, but use a non standard port (8000) on their C2... If you plan to do something like that, use 443 at least, many corporate network do not filter this one ;)

Blackthorntoday at 3:50 PM

Do we have a way yet to tell if something on our system is compromised? There's plenty of end user software built on node, like Gemini CLI and LM Studio.

kjoktoday at 5:25 PM

Curious to know why are coding agents not detecting such risks before importing dependencies?

show 1 reply
darepublictoday at 1:40 PM

I used axios in the distant past but haven't used it whenever I had my say in the past five years. You don't need it, and for special things like retries I could roll my own just fine. Now ai will roll it for you

mtudtoday at 2:54 AM

Supply chain woes continue

show 2 replies
aizktoday at 6:34 AM

In light of these nonstop supply chain attacks: Tonight I created /supply-chain-audit -- A simple claude code skill that fetches info on the latest major package vulnerability, then scans your entire ~/ and gives you a report on all your projects.

https://github.com/IsaacGemal/claude-skills

It's a bit janky right now but I'd be interested to hear what people think about it.

show 1 reply
6thbittoday at 2:11 PM

> published manually via a stolen npm access token with no OIDC binding and no gitHead

So this and litellm one would’ve been preventable by proper config of OIDC Trusted Publishers.

1970-01-01today at 1:49 PM

Is this Jia Tan 5.0? I've lost count. You really should stop trusting packages (implicitly). Or don't. It's your funeral, not mine. See you at Jia Tan 6.0 April?

show 1 reply
hyperadvancedtoday at 6:26 AM

Just sanity checking - if I only ever install axios in a container that has no secrets mounted in to its env, is there any real way I can get pwned by this kind of thing?

show 1 reply
pagecalmtoday at 6:16 PM

This is the part that's tough — we push everyone to keep dependencies updated and automate it with Renovate or Dependabot, but that's exactly the pipeline that would have pulled this in before anyone noticed. Lockfiles and pinning help slow it down, but most teams pair those with automated update PRs which kind of negates the point. You can reduce your dependency surface area to lower the odds but one compromised maintainer on a top-10 package and none of that matters.

Ciantictoday at 9:09 AM

NPM should learn from Linux distribution package managers.

Have a branch called testing, and packages stay in testing for few weeks, after which they go to stable. That is how many Linux distributions handle packages. It would have prevented many of these.

Advising every user of npm/pnpm to change their settings and set their own cooldown periods is not a real choice.

show 2 replies
_pdp_today at 9:59 AM

I am not saying this is the reason for this compromise but the sudden explosion of coding assistant like claude code, and tools like openclaw is teaching entire crop of developers (and users) that it is ok to have sensitive credentials .env files.

show 1 reply
Sidmo2006today at 3:35 PM

Ofc this happens the day we launch on product hunt. The last time we launched, AWS went down.

show 1 reply
dhruv3006today at 4:17 AM

174025 dependents.

samuelknighttoday at 12:30 PM

Absolute wave of supply chain attacks recently. Hopefully this causes everyone to tighten up their dependencies and update policies.

neyatoday at 6:56 AM

I wonder if this has any connection with the recent string of attacks including the FBI director getting hacked. The attack surface is large, executed extremely cleanly - almost as if done by a high profile state sponsored actor, just like in Hollywood movies.

davikrtoday at 3:11 PM

Why can't we freeze the version of globally installed packages with npm?

croemertoday at 11:52 AM

I'm impressed how this was caught as a network anomaly in a GitHub actions monitoring tool.

This might have taken a lot longer to discover, otherwise.

ex-aws-dudetoday at 3:11 PM

Why is it with Javascript the culture is to use so many dependencies?

show 1 reply
twodavetoday at 1:01 PM

Can we get a non-AI-generated article for this? I think the aikido one might be fine, but if there’s a more official source let’s use that in lieu of this AI nonsense.

webprofusiontoday at 8:54 AM

My first thought was does VS Code Insiders use it (or anything it relies on, or do any extensions etc). Made me think.

neyatoday at 6:48 AM

The NPM ecosystem is a joke. I don't even want anything to do with it, because my stack is fully Elixir. But, just because of this one dependency that is used in some interfaces within my codebase, I need to go back to all my apps and fix it. Sigh.

JavaScript, its entire ecosystem is just a pack of cards, I swear. What a fucking joke.

dinakerneltoday at 8:30 AM

Default setting latest should be caught in every static code scanner. How many times has this issue been raised.

JCharantetoday at 12:18 PM

I don't see how a system that relies on trust can scale safely

stevenmhtoday at 4:53 AM

This is why Node.js is completely unsuitable as backend. Until recently, there wasn’t even a standard Promise-based HTTP client. Why should we need to download a library just to make a simple HTTP request? It’s because Node.js’s standard library is too limited, leading to an explosive growth in third-party libraries. As a result, it’s vulnerable to security attacks, and maintaining it in an enterprise environment becomes a major challenge. Let’s use .NET or Go. Why use JavaScript outside of the browser when there are excellent backend environments out there?

Kinranytoday at 6:12 AM

Running almost anything via npx will trigger this

show 1 reply
rtpgtoday at 4:28 AM

Please can we just have a 2FA step on publishing? Do we really need a release to be entirely and fully automated?

It won't stop all attacks but definitely would stop some of these

tonymettoday at 3:25 PM

1/5 of your CLI and 1/3 of your gui apps are npm based. Each one has 400+ dependencies , none notable enough to go viral when they are breached. And who knows what other packages are currently compromised. We all have 30+ node_modules on our disks, and 2/3 of them were shipped by outside vendors , packaged in an archive.

“I’m smart I use fetch instead of axios”. “I pin my versions” – sure but certainly one of your npx or Electron apps uses axios or another less notably compromised package.

Let’s

sgttoday at 7:43 AM

Is this an issue for those only using axios on the frontend side like in a VueJS app?

show 1 reply
croemertoday at 8:14 AM

I lost respect for Axios when they made a breaking change in a patch release. Digging into the root cause, I found the maintainer had approved an outside PR with an obvious AI slop PR description: https://github.com/axios/axios/issues/7059

Looks like the maintainer wasn't just careless when reviewing PRs.

show 2 replies
rk06today at 11:32 AM

> This creates a secondary deception layer. After infection, running npm list in the project directory will report [email protected] — because npm list reads the version field from the installed package.json, which now says 4.2.0. An incident responder checking installed packages would see a version number that does not match the malicious 4.2.1 version they were told to look for, potentially leading them to conclude the system was not compromised.

WTF!!!! gaslighting your victims into believing they are not victims. the ingenuity of this is truly mindblowing. I am shocked at such thing is even allowed. like packages should not be able to modify their contents while they are being instaleld.

leventhantoday at 5:28 AM

PSA: Make sure to set a minimum release age and pin versions where possible.

0x500x79today at 4:09 AM

Pin your dependencies folks! Audit and don't upgrade to every brand new version.

show 1 reply
classifiedtoday at 5:22 PM

How anybody is still using NPM is beyond me.

diego_sandovaltoday at 12:14 PM

A new day, a new npm incident.

cachiustoday at 5:02 PM

Uh Axios. Even after being years out of NPM dev I remember that as the XHR thing for node. Whichs rings a big hit even to out of the loop people...

jFriedensreichtoday at 12:44 PM

Just a reminder that you can run most node things with deno run and have opt in permissions, audit trail and even external permission system integration now. The gotcha is that "deno task <<some package.json script>>" will NOT execute with this model which I find extremely unintuitive and had me thinking deno abandoned its sandbox for nodejs compatibility completely.

silverwindtoday at 8:47 AM

npm really needs to provide a options to set individual packages to only be publishable via trusted publishing.

anthktoday at 11:56 AM

Guix saves you from this. You can import NPM packages in a container (not even touching $HOME) and giving you a shell on the spot with just the dependencies and nothing more.

Learn about 'guix import'.

Oh, and you can install Guix on any GNU/Linux distro.

Kuyawatoday at 1:43 PM

node:fetch is all you need, simple and effective

maelitotoday at 8:47 AM

Glad to be using native fetch.

8cvor6j844qw_d6today at 3:34 AM

Should increase the delay to dependency updates.

show 1 reply
ksk23today at 6:47 AM

One paragraph is written two times??

🔗 View 35 more comments