Forget SLSA: the latest high-impact supply-chain attack on the npm registry (and PyPy), is once again astonishing in modality and in scope. It's part of the so-called "Mini Shai-Hulud campaign," but to understand how the infection precisely works, I asked Gemini using a series of refined prompts to explain it. This is the edited final response. Link to the attack in the first comment. By the way, this time it got TanStack (!)
-
An attacker submits a seemingly legitimate Pull Request to a popular open-source repository (e.g., package "XYZ").
-
If the repo uses pull_request_target to run automated tests on external contributions, the pipeline starts immediately when the PR is opened, before any human maintainer has reviewed or merged the code.
-
During the npm install or npm test phase within the GitHub Actions runner, the malicious script embedded in the PR executes in a privileged environment.
-
The malware scrapes the runner’s memory to "hijack" the temporary OIDC token (OpenID Connect) generated for that session.
-
Using that legitimate token, the worm automatically publishes a new, infected version of XYZ (e.g., v1.2.4) directly to the registry. This version now carries a "Verified" provenance badge, making it look authentic.
-
Anyone downloading the new version, whether a developer or another automated pipeline, becomes a new host. The worm then looks for new secrets and new repositories to infect, scaling the attack exponentially.
Originally posted on LinkedIn.