Published November 5, 2026 · Confidence: high · Complexity 8/10
TanStack npm Supply-Chain Compromise: pull_request_target, Cache Poisoning, and OIDC Token Extraction Chained Attack
On May 11, 2026 between 19:20 and 19:26 UTC, an attacker published 84 malicious versions across 42 @tanstack/* npm packages by chaining three vulnerabilities: the pull_request_target "Pwn Request" pattern in bundle-size.yml, GitHub Actions cache poisoning across the fork↔base trust boundary, and runtime memory extraction of an OIDC token from the GitHub Actions runner process. The malware harvested credentials from AWS, GCP, Kubernetes, Vault, GitHub, npm, and SSH locations and exfiltrated them through the Session/Oxen encrypted messenger network. The malicious versions were detected by an external researcher within 20–26 minutes and fully deprecated by the maintainers within approximately 1 hour 43 minutes.
Investigation trace
Facts, hypotheses, timeline steps, and evidence reconstructed directly from the public incident record.
Problem statement
On 2026-05-11 between 19:20 and 19:26 UTC, 84 malicious versions across 42 @tanstack/router and @tanstack/start monorepo packages were published to the npm registry. Any developer or CI environment that ran npm install, pnpm install, or yarn install against an affected version during this window had credentials harvested from common locations and exfiltrated, with the install host potentially fully compromised. The malicious publish was authenticated through the legitimate npm OIDC trusted-publisher binding for the TanStack/router repository, so it carried the same trusted-publisher authentication as a legitimate release.
What investigators first believed
- The npm publish workflow itself was directly compromised
- An npm token was stolen and used for the publish
- Multiple TanStack repositories or package families were affected
- The attack used novel, custom-built tradecraft
How the diagnosis unfolded
- 01
External researcher ashishkurmi (StepSecurity) opens GitHub issue #7383 with complete technical writeup identifying a malicious optionalDependencies fingerprint across 14 @tanstack/* packages
Initial scope of compromise identified: 14 packages, 28 versions. IOC pattern established: optionalDependencies pointing to orphan GitHub commit, router_init.js payload, and exfiltration domains
- 02
Researcher notifies npm security directly; Manuel (maintainer) acknowledges in #7383 and begins incident response
Incident response activated ~40 minutes after the first malicious publish (Manuel acknowledges ~20:00 UTC). npm security engaged in parallel
- 03
Manuel removes all other team push permissions on GitHub as a precaution against potentially compromised maintainer machines
Blast radius contained on the GitHub side — no further unauthorized pushes possible from any account
- 04
Tanner deprecates the first two malicious versions (@tanstack/[email protected] and @1.161.12), then runs batch deprecation across the initial 14-package scope
28 of 84 malicious versions deprecated by ~20:41 UTC, ~1h 21m after the first publish
- 05
Comprehensive scan of all 295 @tanstack/* packages on the npm registry to confirm full scope
Full scope identified: 42 packages, 84 versions — 28 more than the initial StepSecurity report. Confirmed that @tanstack/query, @tanstack/table, @tanstack/form, @tanstack/virtual, @tanstack/store, and other families were unaffected
- 06
Final batch deprecation runs covering the remaining versions to reach the full 42-package / 84-version scope
All 84 malicious versions deprecated within 1 hour 43 minutes of first publish
- 07
Investigation traces the attack vector: analysis of bundle-size.yml pull_request_target workflow, review of PR #7378 from fork zblgg/configuration, examination of GitHub Actions cache entries for TanStack/router
Attack vector identified as three-stage chain: (1) pull_request_target in bundle-size.yml executed fork-controlled code, (2) that code poisoned the pnpm-store cache under the key release.yml would restore, (3) the poisoned cache delivered attacker binaries into the release runner which extracted the OIDC token from runner process memory and POSTed directly to registry.npmjs.org
- 08
All GitHub Actions cache entries for all TanStack/* repositories purged via API; hardening PR merged restructuring bundle-size.yml with repository_owner guards and pinning third-party action refs to SHAs
Cache poisoning vector neutralized across all TanStack repos. Workflow hardened against future pull_request_target exploitation
What narrowed the fault domain
External researcher ashishkurmi (StepSecurity) GitHub issue #7383 filed at 19:46 UTC — approximately 26 minutes after the first malicious publish (20 minutes after the second batch) — containing complete technical analysis of the malicious optionalDependencies fingerprint, package list, and exfiltration infrastructure
Compromise was detected externally, not through internal monitoring. The IOC pattern was immediately actionable: malicious optionalDependencies entry pointing to orphan commit 79ac49eedf774dd4b0cfa308722bc463cfe5885c in the TanStack/router fork network
Package manifest inspection of affected versions revealed optionalDependencies entry '@tanstack/setup': 'github:tanstack/router#79ac49eedf774dd4b0cfa308722bc463cfe5885c' and a ~2.3 MB obfuscated router_init.js file in the package root not listed in the package's 'files' field
The malicious payload was smuggled through npm's optionalDependencies mechanism — npm resolves the GitHub dependency, fetches the orphan commit from the fork network, and runs the prepare lifecycle script, executing router_init.js before the package's own code loads
GitHub Actions cache entry Linux-pnpm-store-6f9233a50def742c09fde54f56553d6b449a535adf87d4083690539f49ae4da11 (1.1 GB) saved at 11:29 UTC on 2026-05-11 from a bundle-size.yml pull_request_target run on PR #7378, then restored at 19:15:44 and 19:16:22 UTC by two separate release.yml workflow runs on pushes to main
The cache key was computed from hashFiles('**/pnpm-lock.yaml'), making it deterministic and predictable. The poisoned entry, saved from a fork PR's workflow run, was restored unchanged by the production release workflow because GitHub Actions cache scope is per-repository and pull_request_target runs share the base repository's cache scope
bundle-size.yml workflow file inspection: on.pull_request_target triggered for fork PRs, the benchmark-pr job used actions/[email protected] with ref: refs/pull/${{ github.event.pull_request.number }}/merge (checking out the fork's merged code), then executed pnpm nx run @benchmarks/bundle-size:build which invoked the fork-controlled vite_setup.mjs
The pull_request_target trigger runs in the base repository's context with full access to the base repo's cache scope, but the checkout step pulled and executed code from the untrusted fork. The workflow author's intended trust split (separate comment-pr and benchmark-pr jobs) was undermined by actions/cache@v5's post-job save using a runner-internal token not gated by the workflow's permissions: contents: read setting
npm registry logs showed the malicious publishes were authenticated via the legitimate OIDC trusted-publisher binding for TanStack/router release.yml@refs/heads/main, but the publish did not originate from the workflow's defined Publish Packages step — that step was skipped because tests failed
The attacker did not need to steal an npm token. The OIDC token was minted by the GitHub Actions runner (triggered by id-token: write permission) and extracted from the runner process's memory via /proc/*/maps and /proc/*/mem, then used to POST directly to registry.npmjs.org — bypassing the workflow's intended publish gate entirely
The OIDC token memory-extraction technique used a verbatim Python script with attribution comment from the tj-actions/changed-files compromise of March 2025 — the attacker recombined published research rather than developing novel tradecraft
The attack was not novel; it was a recombination of known techniques. This means defenses against each individual component (pull_request_target hardening, cache scope isolation, OIDC token memory protection) already existed in published security guidance but had not been applied
Comprehensive scan of all 295 @tanstack/* packages on the npm registry confirmed 42 packages and 84 versions affected — all within the @tanstack/router and @tanstack/start monorepo. Confirmed-clean families: @tanstack/query, @tanstack/table, @tanstack/form, @tanstack/virtual, @tanstack/store, and all other TanStack packages
The compromise was contained to packages published from the Router/Start monorepo, which was the only TanStack repository using pull_request_target in its CI configuration. The blast radius was narrower than initial public concern suggested
Attacker fork github.com/zblgg/configuration was deliberately renamed from the repository name (router → configuration) to evade fork-list searches. PR #7378 was force-pushed back to main HEAD (b1c061af) at 11:31 UTC, making the visible PR a 0-file no-op, then the PR was closed and the branch deleted — but the cache entry persisted
The attacker took deliberate steps to hide the fork from casual discovery and erase visible traces of the attack from the PR. The cache poisoning persisted independently of the PR's lifecycle because GitHub Actions cache entries are not invalidated when a PR is closed or its branch is deleted
Key turning points
- External researcher ashishkurmi (StepSecurity) files GitHub issue #7383 at 19:46 UTC with complete IOC fingerprint — without this external detection, the malicious packages would have remained in the registry with no internal alerting to trigger a response
- Comprehensive registry scan reveals the full scope is 42 packages and 84 versions — triple the initial 14-package report — confirming the attack's ambition and the need to scan all 295 @tanstack/* packages
- Investigation identifies bundle-size.yml pull_request_target as the initial entry vector — the cache poisoning chain is traced from PR #7378 through the cache entry saved at 11:29 UTC to the release workflow runs at 19:15–19:16 UTC
- Discovery that the publish authenticated via OIDC token extraction from runner process memory, not a stolen npm token — this explains why no credential theft was detected and reveals that the workflow's Publish Packages step was bypassed entirely
- Confirmation that only the Router/Start monorepo was affected and all other TanStack package families (@tanstack/query, @tanstack/table, etc.) were clean — narrowing the blast radius and allowing targeted consumer guidance
Root cause
Three vulnerabilities were chained — each necessary but individually insufficient. (1) pull_request_target "Pwn Request" pattern: bundle-size.yml used pull_request_target for fork PRs and, inside that trigger context, checked out the fork's PR-merge ref via actions/checkout and executed fork-controlled build code through pnpm nx run. The pull_request_target trigger runs in the base repository's context and shares the base repo's GitHub Actions cache scope, despite the workflow author's attempt at a trust split. (2) GitHub Actions cache poisoning across trust boundaries: the malicious vite_setup.mjs wrote data into the pnpm-store directory under a cache key deterministically computed from hashFiles('**/pnpm-lock.yaml'). When the benchmark-pr job ended, actions/cache@v5's post-step saved the poisoned store using a runner-internal token not gated by the workflow's permissions: contents: read setting. The production release.yml workflow later restored this poisoned entry on pushes to main. (3) OIDC token memory extraction: with the poisoned pnpm store restored, attacker-controlled binaries ran during the build step, located the GitHub Actions Runner.Worker process via /proc/*/cmdline, read /proc/<pid>/maps and /proc/<pid>/mem to dump the worker's memory, extracted the OIDC token minted due to id-token: write permission, and used it to POST directly to registry.npmjs.org — bypassing the workflow's defined Publish Packages step which was skipped because tests failed.
Resolution
All 84 malicious versions across 42 packages deprecated within 1 hour 43 minutes of first publish. npm removed affected tarballs registry-side within 4 hours 35 minutes. All GitHub Actions cache entries for all TanStack/* repositories purged via API. bundle-size.yml restructured with repository_owner guards to prevent execution on fork PRs, and all third-party action refs pinned to commit SHAs instead of floating tags. Official GitHub Security Advisory GHSA-g7cv-rxg3-hmpx published with full IOC list. Formal malware reports submitted to npm and GitHub security. Public disclosure across Twitter/X, LinkedIn, and Bluesky. Three-day full security sweep and hardening pass completed across all TanStack repositories. All currently-available published versions of every TanStack package — Router and Start included — confirmed safe to install. Consumers who installed affected versions advised to rotate AWS, GCP, Kubernetes, Vault, GitHub, npm, and SSH credentials.
Lessons from the response
- External researchers detected and reported the compromise with full technical detail within ~20 minutes — detection community already had clear public IOC patterns within hours, demonstrating the value of third-party supply-chain monitoring
- No internal alerting existed on package publishes — the team learned about the compromise from a third party and had no automated monitoring to detect anomalous publishes from their own workflows
- pull_request_target workflows had not been audited despite being a long-known dangerous pattern — hardening should include repository_owner guards to prevent execution on fork PRs, and workflows using pull_request_target should never check out or execute code from the PR head or merge ref
- Floating refs (@v6.0.2, @main) on third-party GitHub Actions should be pinned to commit SHAs to prevent tag-mutation attacks and ensure reproducible, auditable workflow execution
- GitHub Actions cache poisoning across trust boundaries is a known design issue (documented by Adnan Khan in 2024) that requires conscious mitigation — cache scope is per-repository, and pull_request_target runs share the base repo's cache scope regardless of workflow permissions settings
- OIDC token memory extraction from the GitHub Actions runner process is a known technique (same verbatim script used in the tj-actions/changed-files compromise of March 2025) — id-token: write permission should be scoped to the minimum necessary jobs, and runners should be treated as potentially compromised environments
Reusable diagnostic principles, high-value signals, and anti-patterns synthesized from the reported facts above.
Troubleshooting principles
- 01
When a compromise is detected through external reporting, immediately scan the full attack surface rather than limiting response to the reporter's initial scope — the initial report covered 14 packages but the full scope was 42
- 02
Cache entries written by pull_request_target workflows share scope with production workflows on main — any cache key computable by a PR must be treated as potentially attacker-controlled when restored in a privileged context
- 03
OIDC tokens exist in plaintext in the GitHub Actions runner process memory — any code executing on the runner during a job with id-token: write can extract and misuse them, so publish steps must be isolated from any code that touched untrusted input
- 04
Supply-chain attacks that recombine published research are not novel zero-days — search for prior incidents using the same techniques (the /proc/mem extraction was a verbatim replay of tj-actions) before treating the attack as unprecedented
- 05
The time between detection and full remediation is measured in the gap between the initial scope and the true scope — aggressive full-surface scanning bought back critical minutes
- 06
pull_request_target workflows are a trust-boundary defect by design — the only safe operations in that trigger context are those that never execute fork-controlled code and never mutate shared state like caches
Effective techniques
- External researcher identified the malicious optionalDependencies fingerprint within 20 minutes and published a complete IOC pattern
- Full-scope scanning of all 295 @tanstack/* packages revealed 28 more affected packages beyond the initial 14-package report
- Cache-key forensics traced the exact poisoned cache entry back to the specific pull_request_target workflow run that wrote it
- Precise timeline reconstruction using GitHub API and npm registry timestamps established the chain of causality across three systems
- Identifying the /proc/*/mem OIDC extraction as a verbatim replay of the tj-actions/changed-files March 2025 compromise rather than novel tradecraft
- The trust-boundary analysis decomposed the attack into three necessary chained vulnerabilities, none sufficient alone
High-value evidence sources
- npm registry publish timestamps cross-referenced against GitHub Actions workflow run start/completion timestamps — the publishes occurred during workflow runs 25613093674 and 25691781302, not from any external credential leak
- The malicious optionalDependencies field in affected package.json manifests pointing to github:tanstack/router#79ac49eedf... — a stable IOC fingerprint detectable at install time
- GitHub Actions cache-key forensics: the poisoned cache entry Linux-pnpm-store-6f9233... was written by bundle-size.yml pull_request_target run at 11:29 UTC and restored by release.yml at 19:16 UTC, proving cache poisoning was the bridge
- The verbatim Python /proc/*/mem extraction script with attribution comment matching the tj-actions March 2025 attack — this established the technique was replayed, not novel, narrowing the investigation to known OIDC extraction patterns
- The forged commit identity claude <[email protected]> on the fork — a fabricated GitHub no-reply email that signaled the attacker was constructing a false identity rather than using a compromised real account
- Workflow run attempt #4 (25613093674) being a re-run of a days-old merged PR — the re-run was the attacker's chosen trigger because it would use the same poisoned cache without a new push
Common diagnostic traps
- No internal publish monitoring — the compromise was detected exclusively by an external third party (StepSecurity), meaning the team had zero visibility into their own registry activity
- pull_request_target workflows had never been audited despite the 'Pwn Request' pattern being a publicly documented attack class for years
- The workflow author attempted a trust split (benchmark-pr vs. comment-pr jobs) but missed that actions/cache@v5 post-job saves use a runner-internal token not gated by workflow permissions: contents: read
- No first-time-contributor approval gating on pull_request_target — PR #7378 auto-ran without any maintainer approval because pull_request_target bypasses that gate
- Floating refs on third-party GitHub Actions (@v6.0.2, @main) were used instead of pinned commit SHAs, creating an unvetted trust surface inside the workflow
Anti-patterns observed
- Treating pull_request_target as safe because 'the build step only runs benchmarks' — any code execution from an untrusted fork in the base repo's context is a trust-boundary violation regardless of what the code claims to do
- Assuming that deprecating packages is sufficient cleanup — npm registry-side tarball removal required separate engagement with npm security and took hours longer
- Relying on fork-list monitoring without accounting for renamed forks — the attacker renamed the fork to 'configuration' to evade name-based searches against the router repo
- Believing that deleting the PR and branch removes the threat — the cache entry persisted independently, and the malicious commit remained reachable in the fork network as an orphan ref
Three independently documented but rarely chained vulnerabilities (pull_request_target code execution, cross-trust-boundary cache poisoning, and runtime OIDC memory extraction) were combined across four systems — a fork network, GitHub Actions cache, a CI runner's process memory, and the npm registry — with precise timing precision. The attacker used no novel tradecraft but assembled published techniques into a chain where each link bridged a trust boundary the others assumed. The investigation required reconstructing causality across GitHub API logs, npm registry timestamps, and Linux /proc/mem forensics, while the attack surface spanned 295 packages and required distinguishing truly affected packages from false positives in the monorepo.
Questions answered
What happened in the TanStack npm Supply-Chain Compromise: pull_request_target, Cache Poisoning, and OIDC Token Extraction Chained Attack incident?
On 2026-05-11 between 19:20 and 19:26 UTC, 84 malicious versions across 42 @tanstack/router and @tanstack/start monorepo packages were published to the npm registry. Any developer or CI environment that ran npm install, pnpm install, or yarn install against an affected version during this window had credentials harvested from common locations and exfiltrated, with the install host potentially fully compromised. The malicious publish was authenticated through the legitimate npm OIDC trusted-publisher binding for the TanStack/router repository, so it carried the same trusted-publisher authentication as a legitimate release.
What was the root cause?
Three vulnerabilities were chained — each necessary but individually insufficient. (1) pull_request_target "Pwn Request" pattern: bundle-size.yml used pull_request_target for fork PRs and, inside that trigger context, checked out the fork's PR-merge ref via actions/checkout and executed fork-controlled build code through pnpm nx run. The pull_request_target trigger runs in the base repository's context and shares the base repo's GitHub Actions cache scope, despite the workflow author's attempt at a trust split. (2) GitHub Actions cache poisoning across trust boundaries: the malicious vite_setup.mjs wrote data into the pnpm-store directory under a cache key deterministically computed from hashFiles('**/pnpm-lock.yaml'). When the benchmark-pr job ended, actions/cache@v5's post-step saved the poisoned store using a runner-internal token not gated by the workflow's permissions: contents: read setting. The production release.yml workflow later restored this poisoned entry on pushes to main. (3) OIDC token memory extraction: with the poisoned pnpm store restored, attacker-controlled binaries ran during the build step, located the GitHub Actions Runner.Worker process via /proc/*/cmdline, read /proc/<pid>/maps and /proc/<pid>/mem to dump the worker's memory, extracted the OIDC token minted due to id-token: write permission, and used it to POST directly to registry.npmjs.org — bypassing the workflow's defined Publish Packages step which was skipped because tests failed.
How was the root cause discovered?
External researcher ashishkurmi (StepSecurity) files GitHub issue #7383 at 19:46 UTC with complete IOC fingerprint — without this external detection, the malicious packages would have remained in the registry with no internal alerting to trigger a response Comprehensive registry scan reveals the full scope is 42 packages and 84 versions — triple the initial 14-package report — confirming the attack's ambition and the need to scan all 295 @tanstack/* packages Investigation identifies bundle-size.yml pull_request_target as the initial entry vector — the cache poisoning chain is traced from PR #7378 through the cache entry saved at 11:29 UTC to the release workflow runs at 19:15–19:16 UTC Discovery that the publish authenticated via OIDC token extraction from runner process memory, not a stolen npm token — this explains why no credential theft was detected and reveals that the workflow's Publish Packages step was bypassed entirely Confirmation that only the Router/Start monorepo was affected and all other TanStack package families (@tanstack/query, @tanstack/table, etc.) were clean — narrowing the blast radius and allowing targeted consumer guidance
What evidence mattered most?
Compromise was detected externally, not through internal monitoring. The IOC pattern was immediately actionable: malicious optionalDependencies entry pointing to orphan commit 79ac49eedf774dd4b0cfa308722bc463cfe5885c in the TanStack/router fork network The malicious payload was smuggled through npm's optionalDependencies mechanism — npm resolves the GitHub dependency, fetches the orphan commit from the fork network, and runs the prepare lifecycle script, executing router_init.js before the package's own code loads The cache key was computed from hashFiles('**/pnpm-lock.yaml'), making it deterministic and predictable. The poisoned entry, saved from a fork PR's workflow run, was restored unchanged by the production release workflow because GitHub Actions cache scope is per-repository and pull_request_target runs share the base repository's cache scope
Which assumptions were wrong?
That permissions: contents: read would block cache mutation — it does not because cache writes use a runner-internal token, not the workflow GITHUB_TOKEN That separating the benchmark-pr job (read-only) from the comment-pr job constituted a sufficient trust boundary — cache scope is shared across both pull_request_target runs and pushes to main within the same repo That the workflow's Publish Packages step was the only path to npm — the OIDC token was minted in memory and the malware posted directly to registry.npmjs.org, bypassing the workflow step entirely That renaming a fork or deleting the PR branch would erase the evidence — the malicious commit persisted in the fork network as an orphan ref, and the cache entry survived PR closure
What delayed recovery?
The approved record describes restoration as follows: All 84 malicious versions across 42 packages deprecated within 1 hour 43 minutes of first publish. npm removed affected tarballs registry-side within 4 hours 35 minutes. All GitHub Actions cache entries for all TanStack/* repositories purged via API. bundle-size.yml restructured with repository_owner guards to prevent execution on fork PRs, and all third-party action refs pinned to commit SHAs instead of floating tags. Official GitHub Security Advisory GHSA-g7cv-rxg3-hmpx published with full IOC list. Formal malware reports submitted to npm and GitHub security. Public disclosure across Twitter/X, LinkedIn, and Bluesky. Three-day full security sweep and hardening pass completed across all TanStack repositories. All currently-available published versions of every TanStack package — Router and Start included — confirmed safe to install. Consumers who installed affected versions advised to rotate AWS, GCP, Kubernetes, Vault, GitHub, npm, and SSH credentials. It does not separately quantify a recovery delay unless stated in that account.
What should operators learn from this case?
External researchers detected and reported the compromise with full technical detail within ~20 minutes — detection community already had clear public IOC patterns within hours, demonstrating the value of third-party supply-chain monitoring No internal alerting existed on package publishes — the team learned about the compromise from a third party and had no automated monitoring to detect anomalous publishes from their own workflows pull_request_target workflows had not been audited despite being a long-known dangerous pattern — hardening should include repository_owner guards to prevent execution on fork PRs, and workflows using pull_request_target should never check out or execute code from the PR head or merge ref
Apply the diagnostic method
Use the Troubleshooting Field Guide to compare this investigation with the evidence patterns, hypothesis tests, and turning points found across the Casebook.
Original incident source
Root Cause Casebook separates reported facts from analyst synthesis. This public record was explicitly approved before export.