On May 11, 2026, the TanStack open-source project was the target of a brief but highly sophisticated supply chain attack that resulted in the malicious modification of 42 popular npm packages. The attackers demonstrated a deep understanding of modern CI/CD practices, bypassing traditional security controls like credential protection. They leveraged a novel chain of exploits involving a malicious pull request, poisoning the GitHub Actions cache, and stealing a short-lived OpenID Connect (OIDC) token from within the build environment to publish malicious package versions. The payload was a potent credential-stealing malware aimed at developer environments. The incident serves as a critical wake-up call about the security of automated CI/CD pipelines and the evolving tactics of supply chain attackers.
The attack, which occurred between 19:20 and 19:26 UTC, was remarkable for its speed and sophistication. It did not rely on phishing or stealing long-lived API keys. Instead, it manipulated the trusted automation that powers modern software development.
Attack Chain:
pull_request_target trigger, allowing code from the fork to run with elevated permissions. (T1195.001 - Compromise Software Development Tools)T1552.006 - Stored Accounts)T1553 - Subvert Trust Controls)The attack's brilliance lies in its abuse of trusted, ephemeral mechanisms. OIDC tokens are designed to be a more secure alternative to static secrets, but this attack shows that if an attacker can gain execution within the CI/CD environment, even for a moment, they can steal and misuse these tokens.
The payload itself was a comprehensive credential harvester designed to compromise developer workstations and CI/CD environments. Its capabilities included stealing:
.npmrc)It also contained a self-propagation mechanism, meaning that any developer who installed the malicious package and then worked on their own npm package could inadvertently spread the infection further. The rapid detection by external researchers (within 20 minutes) was crucial in limiting the downstream impact.
This attack demonstrates that CI/CD pipelines are not just build tools; they are high-privilege environments and a primary target for attackers. Securing the pipeline itself is as important as securing the code.
The potential impact of this attack was enormous. TanStack tools are used by countless developers and organizations worldwide. A successful, widespread compromise could have led to a catastrophic wave of secondary breaches as developer credentials from thousands of companies were stolen. The payload's ability to steal cloud and Kubernetes credentials means attackers could have gained access to production infrastructure, not just source code. The self-propagation feature could have created a worm-like event within the npm ecosystem. While the quick detection mitigated the worst-case scenario, the incident exposes a systemic risk in the open-source software supply chain.
npm audit or third-party Software Composition Analysis (SCA) tools to detect when a malicious or deprecated version of a dependency is being used.Dynamic Analysis.Secure CI/CD Workflows (M1054 - Software Configuration):
pull_request_target: Never use the pull_request_target trigger for workflows that build, test, or publish code. Use pull_request and workflow_run instead, which run code from forks in a properly isolated context.uses: actions/checkout@a12a3943b43c672646b4de65223a8ba24118e134) instead of a floating tag (@v3) to prevent upstream compromises.Isolate Build Environments (M1048 - Application Isolation and Sandboxing):
Implement Publishing Safeguards:
Developer Environment Security:
npm command-line tool over direct script execution to benefit from its built-in security features. Discourage running arbitrary scripts from dependencies during installation.Grafana Labs source code stolen by 'CoinbaseCartel' due to fallout from TanStack supply chain attack, highlighting cascading impact and missed credential rotation.
Crucial for securing CI/CD pipelines. This includes avoiding insecure triggers like 'pull_request_target' and properly configuring OIDC trust relationships.
Ensures that builds from untrusted sources (like PRs) run in isolated environments without access to secrets or shared resources like the build cache.
Applies to CI/CD environments by using short-lived, narrowly-scoped tokens (like OIDC) and requiring manual approvals for privileged operations like publishing.
The TanStack attack was enabled by a specific misconfiguration in a GitHub Actions workflow. The most direct and impactful countermeasure is to harden these configurations. Specifically, organizations must audit all CI/CD pipelines and prohibit the use of the pull_request_target trigger in any workflow that checks out or executes code from the pull request. This trigger is extremely dangerous as it grants the permissions of the base repository to code from an external fork. Instead, workflows should use the pull_request trigger, which runs in a read-only context, and the workflow_run trigger to act upon the results of the PR check. This configuration change alone would have prevented the initial cache poisoning step of this attack. Security teams should use automated code scanning (e.g., GitHub Advanced Security, Semgrep) to enforce this rule across the entire organization.
While the D3FEND definition is broad, the principle of isolation is key. In the context of the TanStack attack, this translates to strict logical isolation within the CI/CD pipeline. The build process should be broken into distinct, isolated stages. The initial stage, which handles the untrusted pull request code, must run in a completely sandboxed, ephemeral environment. This environment should have no access to secrets, no ability to write to a shared cache, and restricted network access. Only after this stage successfully completes and the code is deemed safe (e.g., merged by a maintainer) should a separate, privileged workflow run to handle tasks like publishing. This privileged workflow should never interact directly with the untrusted PR code. This logical separation prevents a malicious PR from ever gaining access to the high-privilege context where secrets like OIDC tokens are available.
This attack succeeded by stealing and using an OIDC token. Organizations can significantly limit the window of opportunity by implementing strict trust policies on the service provider side (in this case, npm). The OIDC trust relationship between GitHub and npm should be configured with maximum specificity. The policy should only grant publishing tokens to requests originating from a specific repository, a specific branch (e.g., main), and a specific workflow file (e.g., .github/workflows/release.yml). This ensures that even if an attacker finds a way to execute code in a different workflow (e.g., a test workflow), they cannot use that context to request a publishing token. This fine-grained trust policy shrinks the attack surface from 'anywhere in the repository's Actions' to 'only this one specific, protected workflow'.
The supply chain attack begins.
The attack concludes after publishing 84 malicious versions across 42 packages.
The attack is detected by external security researchers approximately 20 minutes after it began.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats
Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.
Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.