The Mini Shai-Hulud Paradox: How Verified SLSA Provenance Was Weaponized to Certify Malware
The Mini Shai-Hulud supply chain attack has compromised over 170 npm and PyPI packages by exploiting OIDC federation and orphaned commits, leading to a confirm…

The supply chain attack dubbed "Mini Shai-Hulud" has turned a modern security gold standard—validated provenance—into a sophisticated attack vector for the npm and PyPI ecosystems. By exploiting a structural flaw in "zero-touch" trust models, the worm has compromised more than 170 open-source packages. Impacted namespaces include critical projects such as TanStack, Mistral AI, and OpenSearch. The vulnerability stems not from a flaw in the source code itself, but from the hijacking of the CI/CD infrastructure.
Attributed to the threat group TeamPCP, the campaign demonstrates that SLSA Build Level 3 provenance is no longer an absolute guarantee of software safety, but merely a certification of a legitimate build process. In this scenario, attackers seized the "authority to speak for the code" directly at the source. The fallout quickly reached corporate environments, with OpenAI confirming the compromise of two internal devices and initiating a massive rotation of its signing certificates.
- The Mini Shai-Hulud worm infected over 170 npm and PyPI packages, including TanStack and OpenSearch, totaling 518 million downloads.
- The infection originated from orphaned commits in GitHub Actions combined with OIDC trust federation, allowing the publication of malware with valid Sigstore signatures.
- OpenAI confirmed a breach of two corporate devices and the exfiltration of limited credentials from internal repositories during the attack.
- The malware features a destructive "dead-man's switch" payload that wipes the home directory if the attacker's token is revoked.
"This is the first documented npm worm that produces validly attested malicious packages." - Ashish Kurmi, StepSecurity (via The Hacker News)
Weaponizing provenance: The SLSA Level 3 paradox
Historically, Sigstore provenance and the SLSA (Supply-chain Levels for Software Artifacts) standard have been championed as the ultimate defense against supply chain attacks. The core premise was that by proving a package was built from a declared source within a protected environment, its integrity was assured. Mini Shai-Hulud has subverted this logic: if the build environment itself is hijacked at the root, provenance becomes a badge of legitimacy for malicious code.
Packages compromised by the worm, such as those in the TanStack ecosystem, were published with authentic SLSA Level 3 attestations. Consequently, many enterprise scanning tools—configured to trust certified builds—permitted the installation of these trojanized versions. This paradox highlights that a digital signature no longer necessarily represents the integrity of a human author; it may simply reflect the success of an automated system hijacked by sophisticated threat actors.
The attack did not require the theft of static secrets or the breach of maintainer passwords. Instead, it hijacked the trust flow linking GitHub to npm via OpenID Connect (OIDC). Once the system recognized the runner as "authorized," it issued a valid attestation for the malware. This allowed the malicious code to propagate without triggering traditional alarms based on reputation or missing cryptographic signatures.
OIDC worm mechanics: The role of orphaned commits
Technical analysis from Phoenix Security and StepSecurity indicates the infection began via an "orphaned commit" in a TanStack GitHub Actions workflow. An orphaned commit is a code fragment sent to a repository that is not linked to any active branch. In this incident, the workflow was configured to trigger on such commits, exposing a critical attack surface within the continuous integration infrastructure.
The compromised workflow utilized OIDC trust federation with the npm registry. The threat actors pushed a malicious commit that, when executed by the GitHub runner, extracted a temporary OIDC token from the process memory. Armed with this token, TeamPCP was able to impersonate the legitimate maintainer. The result was the publication of poisoned package versions, initiating the worm's automatic propagation.
Once installed, the worm began exfiltrating CI/CD credentials and access tokens from developer systems. These secrets were then used to target other high-profile namespaces, including Mistral AI, Guardrails AI, and OpenSearch. Within the TanStack ecosystem alone, 84 compromised versions were identified. The OpenSearch package, which sees 1.3 million weekly downloads, served as a global multiplier for the infection.
OpenAI breach: Corporate infrastructure impact
The reach of Mini Shai-Hulud extended into OpenAI's corporate environment. The company officially confirmed that two employee devices were compromised. OpenAI detected activity consistent with the malware's behavior, specifically the targeted exfiltration of credentials from a limited subset of internal source repositories to which the employees had legitimate access.
The incident clarifies that OpenAI was not targeted via a "compromised package" in a registry, but rather fell victim as a corporate entity to the worm's lateral movement. In response, OpenAI initiated a preemptive rotation of all signing certificates for its applications on macOS, Windows, iOS, and Android. Notably, macOS users must update their applications by June 12, 2026, after which legacy certificates will be revoked by Apple.
While OpenAI has implemented these remediation measures, it remains unconfirmed whether the signing certificates were actually abused to sign malicious software; the action was described as a precaution following the credential exfiltration. The incident underscores the thin line between open-source development environments and private corporate repositories, where a single compromised dependency can serve as a bridge to the heart of an organization.
Payload analysis: Persistence and destructive retaliation
The technical payload, a 2.3 MB JavaScript file named router_init.js, includes advanced persistence and defense mechanisms. The malware embeds itself within .claude/ directories and the .vscode/tasks.json file, ensuring execution whenever a developer uses their standard workspace tools. This technique allows the threat to persist even after the infected npm package is removed using standard commands.
The most aggressive feature of Mini Shai-Hulud is its "dead-man's switch." Every 60 seconds, the malware polls the GitHub API to monitor the status of an npm token created by the attackers. If defenders revoke the token, the payload triggers a destructive rm -rf ~/ command. This punitive measure is designed to destroy forensic evidence and deter system remediation efforts.
The monitored token included the explicit description: "IfYouRevokeThisTokenItWillWipeTheComputerOfTheOwner." This detail confirms the malicious intent of TeamPCP, using digital sabotage as a deterrent against incident response. The exfiltration effort targeted not only static data but actively sought new CI/CD tokens to fuel the cycle of compromise, making the eradication of the worm a complex task for security teams.
Mitigation and response
- Audit lockfiles: Inspect integrity hashes...