Over 170 packages across multiple high-profile NPM and PyPI projects were compromised in a new, coordinated Mini Shai-Hulud software supply chain attack.
The campaign hit 42 TanStack packages, 65 UiPath packages, Mistral AI’s PyPi packages, the OpenSearch JavaScript client, over a dozen Squawk packages, the Guardrails AI PyPI package, and other popular modules.
TeamPCP, the infamous hacking group that orchestrated several supply chain attacks across multiple open source software ecosystems over the past few months, was blamed for the campaign.
Dead-drop commit branch names used in the attack are taken from Frank Herbert’s Dune saga, and the malware’s repositories have the “Shai-Hulud: Here We Go Again” description.
The same as in previous campaigns, the Mini Shai-Hulud worm targets sensitive information, including developer credentials, API keys, tokens, cloud credentials and secrets, cryptocurrency wallets, and secrets associated with AI tools and messaging applications.
It attempts to propagate by using compromised NPM and GitHub Actions tokens to publish malicious versions of the packages the victim has write access to.
The malware was also observed installing a persistent daemon to poll GitHub every minute, to verify for token revocation, and checking the system language to avoid infecting Russian users, cybersecurity firm Wiz notes.
The TanStack attack
The new supply chain campaign was flagged shortly after malicious package artifacts were published through the legitimate TanStack release pipeline, and was then observed spreading to additional packages.
Unlike previous TeamPCP intrusions, which relied on stolen secrets to compromise accounts and modify packages, the TanStack attack chained three known security weaknesses to release 84 malicious artifacts across 42 packages.
The attackers staged their payload in a GitHub fork, injected the payload into published NPM tarballs, and then hijacked the project’s CI/CD pipeline to publish the packages directly to NPM, exploiting the ambient OIDC token in the workflow to bypass the workflow’s own publish step, StepSecurity explains.
“The attacker chained three known vulnerability classes — a pull_request_target ‘Pwn Request’ misconfiguration, GitHub Actions cache poisoning across the fork↔base trust boundary, and runtime memory extraction of the OIDC token from the Actions runner process,” TanStack explains in a post-mortem.
According to Wiz, the attackers renamed their TanStack/router repository fork to zblgg/configuration, then opened a pull request to trigger the pull_request_target workflow, which executed the attackers’ code and poisoned the GitHub Actions cache.
“When legitimate maintainer PRs were later merged to main, the release workflow restored the poisoned cache. Attacker-controlled binaries then extracted OIDC tokens directly from the GitHub Actions runner’s process memory,” Wiz explains.
The stolen GitHub OIDC token allows the attackers to obtain a signing certificate and make the malicious packages appear as having a valid SLSA provenance. Thus, the packages were published under a trusted identity.
“SLSA provenance is a cryptographic certificate, generated by Sigstore, that is meant to verify a package was built from a trusted source. The worm was able to produce these certificates because it hijacked the legitimate build pipeline itself,” Snyk notes.
By exploiting this mechanism, the attackers published two malicious versions of each of the 42 TanStack packages.
The payload
Across all compromised TanStack packages, the same 2.3 MB implant (router_init.js) was injected directly into the package tarball.
The obfuscated single-line JavaScript file contains a multi-stage credential stealer that performs data harvesting and exfiltration, achieves persistence, and can self-destruct.
According to Socket, the implant first fingerprints the environment (operating system, CI platform, and JavaScript runtime), packs different credential harvest paths for Linux and macOS, and performs an online lookup, likely to test network reachability.
“It systematically sweeps every major secrets plane available inside modern cloud-native CI environments, using both direct environment variable reads and active API calls,” Socket explains.
Stolen credentials are exfiltrated via three channels: the https://git-tanstack[.]com domain, Session network (encrypted exfiltration via *.getsession.org), and Dune-themed GitHub repositories created using stolen tokens.
“The Session network channel is new. Decentralized and takedown-resistant, it is significantly harder to disrupt than dedicated domains or GitHub-based exfiltration,” Wiz notes.
For NPM propagation, the worm exploits the GitHub Actions OIDC federation mechanism “to mint a valid NPM publish token on behalf of the compromised CI identity,” Socket explains.
Additionally, the worm uses the GitHub GraphQL API to commit copies of itself to the branches of the compromised maintainers’ source repositories. The commit author is spoofed to impersonate the Anthropic Claude Code GitHub App.
The Python variant
Malicious versions of the Guardrails AI and Mistral AI PyPI packages contained a different payload than the NPM one, Wiz says.
The Guardrails AI package contained 13 lines of new code designed to fetch and execute a non-obfuscated payload from git-tanstack[.]com.
The payload is a modular credential stealer that would only execute on Linux systems. The malware harvests extensive credentials and, for the first time, also targets password managers such as 1Password and Bitwarden.
When executed on systems with Israel or Iran locales, the malware would attempt to play an MP3 file at full volume and to delete the files on the system.
170+ affected packages
What makes the latest TeamPCP supply chain attack notable is the abuse of provenance attestation to publish malicious packages that are indistinguishable from legitimate ones, Snyk notes.
In total, on May 11, the campaign hit over 170 packages across multiple high-profile projects. At least 401 malicious package artifacts were published within a five-hour window, SafeDep says.
Some of the affected packages, such as those in the TanStack namespace, have millions of weekly downloads. The TanStack Router package is used in applications across React, Vue, and Solid.
TeamPCP compromised the official Mistral AI packages across three distribution channels: the core SDK, the Azure integration, and the GCP integration. Three malicious versions of each were published.
The attackers hit 65 UiPath NPM packages, publishing 65 malicious versions across the entire automation platform. The official OpenSearch JavaScript client was also compromised, and the attackers published five malicious versions of 20 Squawk packages.
Users are advised to check if any compromised version of the affected packages reached their environments, clean up their systems, and rotate all potentially compromised credentials and secrets.
They should also audit GitHub Actions OIDC configurations and pull_request_target workflows for cache poisoning, and implement behavioral analysis at install time as an additional protection mechanism alongside provenance verification, Snyk notes.
Related: Checkmarx Jenkins AST Plugin Compromised in Supply Chain Attack
Related: Build Application Firewalls Aim to Stop the Next Supply Chain Attack
Related: SailPoint Discloses GitHub Repository Hack
Related: Vendor Says Daemon Tools Supply Chain Attack Contained
