Skip to main content
TanStack Supply Chain Attack: Two Devices, One Pipeline, Total Credential RotationIncident
4 min readFor Security Engineers

TanStack Supply Chain Attack: Two Devices, One Pipeline, Total Credential Rotation

What Happened

In early 2025, threat actor TeamPCP compromised TanStack's distribution infrastructure and released trojanized versions of npm and PyPI SDKs. Two OpenAI employee devices installed these malicious packages. OpenAI responded by isolating impacted systems, revoking user sessions, rotating all credentials across affected repositories, and temporarily restricting code-deployment workflows. No user data or production systems were compromised, but the incident led Apple to issue macOS security updates with certificates scheduled for revocation on June 12, 2026.

Timeline

The timeline of the initial compromise remains unclear, but the attack followed a familiar pattern in supply chain incidents:

  1. Initial compromise: TeamPCP accessed TanStack's package distribution system.
  2. Malicious package release: Trojanized versions of npm and PyPI SDKs were published.
  3. Installation: Two OpenAI employee devices installed the compromised packages.
  4. Detection: OpenAI identified the compromise (detection method not disclosed).
  5. Response: Full credential rotation, session revocation, and deployment freeze.
  6. Vendor coordination: Apple issued macOS updates with certificate revocation scheduled.

Which Controls Failed or Were Missing

The attack succeeded due to gaps in three control areas:

Dependency verification controls: Employee devices installed packages without verifying the publisher's identity. Standard package managers will pull any version published under a trusted namespace. If that namespace is compromised, malware can be installed.

Build environment isolation: Development machines had access to credentials for production repositories. When compromised, attackers had a direct path to code deployment infrastructure.

Supply chain monitoring: No real-time alerting detected the publication of trojanized packages or flagged unusual package behavior during installation. The compromise was discovered after the fact, not during the attack window.

What the Standards Require

PCI DSS v4.0.1 Requirement 6.3.2 mandates secure development practices, including training on secure coding techniques and security testing during development. This extends to dependency management practices—secure development cannot rely on blindly trusting upstream packages.

NIST 800-53 Rev 5 Control SA-12 (Supply Chain Protection) requires integrity verification tools to detect unauthorized changes to software. For your CI/CD pipeline, this means:

  • Verifying package signatures before installation
  • Maintaining an approved dependency list with known-good hashes
  • Monitoring for unexpected package updates

ISO/IEC 27001:2022 Control 8.30 (Outsourcing) addresses risks in external service dependencies. When using third-party packages, you are outsourcing code execution. Your risk assessment must cover:

  • The security posture of package maintainers
  • The blast radius if a package is compromised
  • Your ability to detect and respond to supply chain incidents

SOC 2 Type II CC6.6 requires logical access controls over data and system resources to support the segregation of incompatible functions. Developer workstations should not hold production deployment credentials. If compromised, attackers should be blocked from reaching production.

Lessons and Action Items for Your Team

1. Lock Down Package Installation

Implement dependency pinning with hash verification. In your package.json or requirements.txt, specify exact versions. In your CI/CD pipeline, verify SHA-256 hashes against a known-good manifest:

# npm
npm ci --integrity

# Python
pip install --require-hashes -r requirements.txt

If the hash doesn't match, the build fails. You control when dependencies update, not your package manager.

Enable package signature verification. npm supports package signatures through the public registry. Configure your .npmrc:

audit=true
audit-level=moderate

For PyPI, use tools like in-toto to verify the provenance chain from source repository to published package.

2. Segment Your Credential Scopes

OpenAI rotated all credentials across impacted repositories. Avoid a situation where one compromised device forces organization-wide credential rotation.

Implement short-lived tokens for CI/CD. Use OIDC federation (GitHub Actions supports this natively) to grant pipeline jobs temporary credentials that expire after the build. Avoid long-lived secrets in environment variables.

Separate development and deployment credentials. Developer machines should have read access to repositories. Write access to production branches requires MFA and occurs through protected CI/CD runners, not from laptops.

Audit credential scope monthly. Run git log --all --grep='password\|token\|key' to find accidentally committed secrets. Use tools like truffleHog or gitleaks in pre-commit hooks.

3. Monitor Your Supply Chain in Real Time

Deploy a Software Bill of Materials (SBOM) scanner. Tools like Syft or SPDX generators create machine-readable inventories of every dependency in your build. Compare each build's SBOM against the previous one. Investigate new transitive dependencies before deploying.

Subscribe to security advisories for your dependencies. GitHub Dependabot, Snyk, or Socket.dev will alert you when a package you use is compromised. Configure these alerts to page your on-call engineer, not just file a ticket.

Implement network egress controls on build runners. Your CI/CD pipeline should only reach out to approved package registries. If a trojanized package tries to contact a command-and-control server, your firewall should block it.

4. Rehearse Your Incident Response

OpenAI's response was effective: isolate, revoke, rotate, restrict. Your team should be able to execute the same playbook in under four hours.

Document your credential inventory. Maintain a living spreadsheet of every API key, deploy token, and service account across your infrastructure. When you need to rotate everything, you cannot afford to discover credentials through archaeology.

Automate credential rotation. Write scripts that rotate AWS keys, GitHub tokens, and database passwords in sequence. Test them quarterly. During an active compromise, manual rotation is too slow and error-prone.

Define your deployment freeze protocol. Determine who has the authority to halt all deployments, how to communicate the freeze to engineering teams, and what the checklist is for lifting the freeze. Document this before an incident occurs.

Supply chain attacks exploit trust. You trust your package manager, upstream maintainers, and that the version you installed yesterday is the same today. The TanStack incident shows that trust is not a control. Verification, segmentation, and monitoring are controls. Implement them before your two compromised devices become two hundred.

supply chain security

Topics:Incident

You Might Also Like