Attackers Do Not Want Your Service
The other day, a development partner asked me, “Could you just take care of these three things?”
npm, pip, bundler. The task was to switch each package-fetching process to go through a proxy with security checks.
Honestly, my first reaction was: “Wait, do I even need to do that?”
The reason was simple. I don’t have access to that partner’s GitHub. The part we work on together is quite limited, and I can’t get into their repositories or the core of their cloud setup. So, I reasoned, even if something dangerous slipped in, the damage would fall on “the people with the permissions,” not on someone like me who’s on the outside. A plausible-sounding argument, if I do say so myself.
Still, I decided to just do what I was asked. The token had already been handed over, and it was only a few lines of commands to type. I deliberately installed a “malicious package” prepared for testing, confirmed it was properly rejected with a 403, and the whole task was done in five minutes.
Then, after it was over, I started looking into the background, and gradually came to realize how completely off the mark my initial reasoning had been.
To begin with, what exactly do these kinds of attacks steal?
The complacency of “I don’t have access rights, so it doesn’t concern me”
My naive understanding was this: “Someone hijacks GitHub or AWS access and runs wild through the repositories or the cloud.” News headlines, for the most part, present it that way too.
My opening thought — “I can’t get into my partner’s GitHub, so it’s not my problem” — and my sense that “I barely use AWS, so being told AWS keys are targeted doesn’t land for me” — come from the same root. I was trying to measure my own level of risk by access rights and service names.
That’s exactly where the trap lies. The moment you try to measure it that way, you get the judgment wrong. As I’ll write below, the essence of this attack lies outside the question of “which services you have access to, and with what permissions.”
A worm named Shai-Hulud
In September 2025, the first “self-replicating worm” ever observed on npm appeared. Shai-Hulud (named after the sandworm of the desert). Starting from a small package called @ctrl/tinycolor, the infection spread to more than 500 packages.
The mechanism was nasty. Once a maintainer’s account was hijacked, the malware automatically rewrote and republished that maintainer’s other packages. Rather than a human planting malware one package at a time, it multiplied on its own. It was literally a worm.
Then in November, a more vicious second wave arrived. Shai-Hulud 2.0, whose repository descriptions read “Sha1-Hulud: The Second Coming.” By some counts, 796 packages were hijacked, and their combined weekly download count exceeded 20 million. Some estimates put the number of affected repositories in the tens of thousands. The trigger point shifted to the pre-install stage, which widened the scope of damage even further. It even came with an aggressive bonus: if it failed, it would try to destroy the victim’s home directory.
And the story doesn’t end in the past tense. Entering 2026, this lineage flared up again as “Mini Shai-Hulud,” and in May it grew into an even larger wave. In just 48 hours, on May 11–12, around 170 packages and more than 400 versions were contaminated, reaching into widely used namespaces such as @tanstack, @mistralai, and @uipath. This time, it spread simultaneously not just through npm but through PyPI as well, dragging the world of pip install into it too. In the latter part of the month, another wave scattered more than 300 versions within just over 20 minutes, and new attacks continued to be observed into June. What’s more troubling: some of these waves didn’t even steal credentials — they hijacked legitimate release pipelines and distributed malware “with genuine signatures.” Even the defensive line of “trust the publisher” has partly been broken.
I only heard about all this quite recently myself. That makes sense, because this isn’t a closed case — it’s still actively burning right now.
The essence is stealing not a “service” but an “environment”
This is the part I most wanted to write about.
The essence of this attack isn’t “targeting a specific service.” It’s “sweeping up every secret sitting in the environment, indiscriminately.”
I’m not a security expert, so what follows is secondhand knowledge, but roughly, it works like this. First, it dumps the entirety of process.env (the list of environment variables) and picks up whatever tokens are in there. It directly reads cloud credential files sitting on disk. And the crowning move is downloading and using a legitimate tool called TruffleHog.
TruffleHog is, in its original purpose, a proper secret scanner for developers — used to check “whether an API key or password was accidentally left behind in code.” It can detect secrets for hundreds of kinds of services. Attackers use it in reverse. That is, they use it to thoroughly dig up whatever secrets remain in your environment, regardless of which service they belong to. They go further, hitting the metadata endpoints of AWS, GCP, and Azure to steal cloud workload credentials as well.
So the question was framed wrong from the start. It isn’t “Are GitHub or AWS being targeted?” The correct framing is this: “Whatever was sitting in your .env or your CI gets taken away entirely, regardless of the service name.”
Stripe keys, database connection strings, Slack tokens, SSH keys — all of it is fair game. In a modern development environment, LLM API keys are probably stuck into .env too, and they get swept up the same way, as just one more “secret that happened to be sitting there.” If it’s there, it gets taken. That’s all there is to it.
This is where my opening line of reasoning falls apart. It’s true that I can’t get into my partner’s GitHub. But the moment I ran their project on my own machine with npm install, the danger was on “my own side.” Whether I have access rights or not is irrelevant. What gets stolen are my own tokens, carelessly sitting on my laptop. Far from being “safe because I’m on the outside,” my environment is itself the entry point.
Taking everything wholesale, without even checking what’s there
This is where we need to shift our thinking.
We normally think about security “individually.” We protect this service’s token this way, we store that API key that way. The image is one of assigning a countermeasure to each item one by one.
But attackers don’t see it that way. They don’t bother checking item by item whether “this key exists” or “that credential exists.” They take the whole environment, wholesale. They can sort through the contents at leisure, after the theft. So the mindset of “guard only the important things rigorously” only works halfway against an adversary that scoops up everything at once.
What’s more, the place most densely packed with content is CI/CD. Build pipelines typically hold production secrets, with strong permissions, carelessly. And I understand that npm’s install-time hooks serve as an entry point for running code with the permissions of the user who performed the install. With a single npm install, a structural pathway is laid out for the secrets of that environment to be extracted.
Vibe coding throws that entry point wide open
Lately, so-called vibe coding has become the norm. You ask an AI, “build me something like this,” and it picks out libraries it judges necessary, runs pip install or npm install on its own, and gets things to a working state. It’s fast, and it’s fun. I use it often myself.
But set against today’s topic, this is quite dangerous.
The pleasure of vibe coding rests on “not scrutinizing things yourself.” If you had to check every time which package, which version, and what install-time scripts came bundled with it, that lightness would disappear. Things get installed without awareness, without full understanding, just to get it done for now. That’s the heart of the experience.
Now layer that against the fact mentioned earlier — that a single npm install can trigger it, and that it spread to PyPI as well. Even back when humans scrutinized and installed packages one at a time, everything still got swept away wholesale. Now, something that isn’t even human does this dozens of times over, without any awareness at all. “Just install it for now” can itself become the single biggest weak point.
There’s an ironic twist too. In the TanStack wave in May, the malicious commit the attacker slipped in carried a forged signature impersonating the official account of an AI coding assistant tool, and it even included a trick to skip CI. The ease of leaving things to AI and an attack that impersonates AI meet in exactly the same place.
Precisely because I’m not an expert, I need at least a basic stance
Honestly, I’m not a systems engineer, and security isn’t my specialty either. So everything explained above is only as far as I was able to research and understand, and anyone knowledgeable would surely find rough spots. Feel free to take it with a grain of salt.
Even so, there’s one stance from all this that clicked into place for me. The sense of security based on access rights or service names — “I don’t use that service,” “I don’t have permission to get in there” — was entirely off-base. If what needs protecting is not the “service” but “the environment itself,” then the very unit of inventory changes.
What CISA and various companies’ defense guides say in unison is simple but severe: “Once infected, assume that every secret present in that development or CI environment has been stolen.” Don’t just rotate the keys for the service that was reported compromised — rotate every token that was sitting in that environment. Not feeling reassured based on service names seems to be the only sensible stance.
In the end, where is the weakest boundary?
Back to “could you just take care of these three things” from the beginning.
That proxy was a good move, closing off one entry point for malicious packages to get in. And indeed, the malicious test package was cleanly rejected.
But what truly needs protecting isn’t just the “entry point.” What needs protecting is the pile of secrets itself, stacked up carelessly on your laptop and in your CI, without even a service-name label attached.
Attackers aren’t targeting your service. What they’re targeting is the state of clutter on your own desk.
The weakest boundary wasn’t the product’s security design. It was the developer’s desk.
Reference links
- CISA, “Widespread Supply Chain Compromise Impacting npm Ecosystem”: https://www.cisa.gov/news-events/alerts/2025/09/23/widespread-supply-chain-compromise-impacting-npm-ecosystem
- Datadog Security Labs, “The Shai-Hulud 2.0 npm worm”: https://securitylabs.datadoghq.com/articles/shai-hulud-2.0-npm-worm/
- Akamai, “Mini Shai-Hulud: The Worm Returns and Goes Public”: https://www.akamai.com/blog/security-research/mini-shai-hulud-worm-returns-goes-public
- Snyk, “TanStack npm Packages Hit by Mini Shai-Hulud”: https://snyk.io/blog/tanstack-npm-packages-compromised/
- Palo Alto Networks Unit 42, “The npm Threat Landscape”: https://unit42.paloaltonetworks.com/monitoring-npm-supply-chain-attacks/
This piece was drafted and directed by Kuzuryu, with the writing done by AI.
Originally published in Japanese at https://clazytech.com/2026/06/1621/. Translated with LLM assistance and reviewed before publication.