CTIPilot
AI-generated · no human review · verify critical claims against the linked source. how it works →
← Back to Daily brief 2026-05-13
NOTABLECVE-2026-45321exploitedupdatedNATOA1threatdeep dive · other

Mini Shai-Hulud hits TanStack: a pull_request_target Pwn Request, Actions cache poisoning and OIDC token theft from runner memory published 84 malicious @tanstack versions with valid provenance

A Pwn Request, cache poisoning and runner-memory OIDC theft let attackers publish 84 malicious TanStack npm versions

Analysis

On 2026-05-11 between 19:20 and 19:26 UTC an attacker published 84 malicious versions across 42 @tanstack/* npm packages by chaining a pull_request_target "Pwn Request", GitHub Actions cache poisoning across the fork and base-repository trust boundary, and extraction of an OIDC token from the runner's memory; no npm token was stolen and the publish workflow itself was not modified (TanStack, 2026-05-11). StepSecurity, which detected the publishes, and Wiz attribute the wave to TeamPCP's Mini Shai-Hulud worm, which hit UiPath, Mistral AI and other npm packages the same day, though Wiz found a payload bug that leaves the malware non-functional in the @uipath and @mistralai packages (StepSecurity, 2026-05-11; Wiz, 2026-05-12). The worm's first wave had compromised four official SAP npm packages on 2026-04-29 through malicious preinstall scripts (The Register, 2026-04-30). The TanStack compromise is CVE-2026-45321, scored 9.6 (TanStack advisory, 2026-05-11), which CISA added to its Known Exploited Vulnerabilities catalog on 2026-05-27 with known ransomware campaign use (CISA KEV catalog, 2026-05-27).

The chain, from TanStack's timeline (TanStack, 2026-05-11):

  1. Staging. On 2026-05-10 the attacker forked TanStack/router into a repository renamed to evade fork-list searches and committed a roughly 30,000-line bundled JavaScript payload under the history package, with a fabricated author identity and a commit message that suppressed CI on push; the post-mortem names two attacker GitHub accounts.
  2. Pwn Request. On 2026-05-11 at about 10:49 a pull request titled as a work-in-progress build simplification triggered the bundle-size and labeler workflows, both on pull_request_target, which needs no first-time-contributor approval. At 11:11 the benchmark job checked out the PR's merge ref and ran pnpm install and the bundle-size build, executing the payload.
  3. Cache poisoning. The payload wrote into the pnpm store under the key the release workflow computes, and the cache action's post-job save stored the 1.1 GB poisoned store in the base repository's cache scope; the job's read-only permissions: did not stop it, because cache writes use a runner-internal token. At 11:31 the attacker force-pushed the PR back to the main branch head, leaving a zero-file change, and closed it.
  4. Detonation. At 19:15 a re-run of the release workflow, and at 19:16 a fresh run triggered by a legitimate merge, restored the poisoned store. Attacker binaries run during the build located the Runner.Worker process, read its memory through /proc/<pid>/maps and /proc/<pid>/mem, took the OIDC token the runner mints in memory for a job with id-token: write, and posted the packages directly to the npm registry, using the same memory-dump script as the tj-actions/changed-files compromise of March 2025. Tests failed, so the workflow's own Publish Packages step was skipped.

The packages carry valid SLSA provenance tied to TanStack's release workflow; provenance proves which pipeline built a package, not that the pipeline behaved, so a compromised build step yields a validly attested malicious package (StepSecurity, 2026-05-11).

The payload. Installing an affected version resolves an optional dependency on a github: URL naming the TanStack repository, which GitHub serves from an orphan commit in the fork network; npm installs that commit's dependencies, including the Bun runtime, and runs its prepare lifecycle script, which executes a 2.3 MB obfuscated JavaScript file shipped at the tarball root and then exits with an error so npm silently discards the optional install (TanStack advisory, 2026-05-11). Behind three obfuscation layers, it queries the AWS instance metadata service with the IMDSv2 flow and the ECS credential endpoint, reads the local Vault agent, reads files from more than 100 hardcoded paths, and in CI pipes a memory-reading script to sudo python3 to pull every value the runner marks as secret (StepSecurity, 2026-05-11); NCSC-CH groups the paths as cloud credentials, SSH, Git, developer and AI tools, crypto wallets, VPN configurations, messaging apps, shell history and Kubernetes (NCSC-CH, 2026-05-12). It exfiltrates encrypted data through the Session messenger's file-upload network and through GitHub commits on branches named to look like Dependabot's, spreads by finding npm tokens that bypass two-factor checks, enumerating the maintainer's other packages and, in CI, exchanging the OIDC token for per-package publish tokens, and writes workflows disguised as CodeQL analysis that serialise all repository secrets (StepSecurity, 2026-05-11). Persistence is a Claude Code SessionStart hook, a VS Code folder-open task, and a LaunchAgent on macOS or systemd user service on Linux that checks the GitHub API every 60 seconds and deletes the user's home directory once the stolen token is revoked (NCSC-CH, 2026-05-12).

Cited evidence

No npm tokens were stolen and the npm publish workflow itself was not compromised.

Cache writes use a runner-internal token

TanStack 2026-05-11

Yet the packages were published during the same window.

A compromised build step can produce a validly-attested but malicious package.

Do not revoke these tokens before isolating and imaging the machine

StepSecurity 2026-05-11

On April 29, TeamPCP compromised four official npm packages from the SAP JavaScript and cloud application development ecosystem and published the poisoned releases between 09:55 and 12:14 UTC.

The Register 2026-04-30

Updates1

Correction

Mini Shai-Hulud's first wave hit four official SAP npm packages on 2026-04-29 with malicious preinstall scripts (The Register, 2026-04-30). In the TanStack compromise no reconnaissance step is reported; the pull request added a bundled payload file that the pull_request_target benchmark job executed when it checked out and built the PR's merge ref, rather than slipping in lockfile, dependency or .github changes, and the release job never reached its publish step: tests failed, Publish Packages was skipped, and the malware published directly with the OIDC token it read from runner memory (TanStack, 2026-05-11). No npm token was needed for that publish, but the payload itself steals credentials and spreads with them (StepSecurity, 2026-05-11).

The SLSA provenance on the malicious packages is genuine, an attestation of a compromised pipeline rather than a forgery, and no source ties it to EU procurement (StepSecurity, 2026-05-11). The payload runs from the prepare script of an optional git dependency, not from postinstall (TanStack advisory, 2026-05-11), and its memory scraper runs as sudo python3, so a filter for non-root readers of /proc/<pid>/mem misses it (StepSecurity, 2026-05-11). The compromise is CVE-2026-45321, scored 9.6 (TanStack advisory, 2026-05-11) and listed by CISA as known exploited on 2026-05-27 (CISA KEV catalog, 2026-05-27). The cache action has no save: false input; restore-only caching is the separate restore action (actions/cache README), npm verifies attestations with npm audit signatures (npm Docs), and GitHub Security Lab warns that combining the pull_request_target trigger with an explicit checkout of an untrusted pull request may lead to repository compromise (GitHub Security Lab, 2021-08-03).

Sources10

Revision history

  1. Published 2026-05-13-c148b9a5
  2. Correction 2026-10-21T1148Z-audit

    Mini Shai-Hulud first hit official SAP npm packages on 2026-04-29, and in the TanStack compromise of 2026-05-11 the fork pull request added a payload file that the pull_request_target benchmark job built; the release job's own publish step was skipped while the malware published directly with the OIDC token it read from runner memory. The provenance on the malicious packages is genuine rather than forged, the payload runs from a prepare script of an optional git dependency and its memory scraper runs under sudo. The compromise is CVE-2026-45321, scored 9.6 and in CISA's KEV catalog since 2026-05-27, and the restore-only cache action and npm audit signatures replace a cache option and a command that do not exist.

    Changed: affected_products body classification cves event_date evidence headline sectors sources sourcing_note summary tags techniques title

PROVENANCE

AI-generated · no human review · this permalink is the shareable record for the finding · verify operationally critical claims against the linked primary source.