Security incidents

How the TanStack supply-chain attack crossed build-pipeline boundaries

Build-state trust: Keep untrusted work out of release. Conceptual security control diagram.

Public report: 11 May 2026. Updated: 17 November 2026.

The TanStack supply-chain attack shows how code from an untrusted contribution can cross into a trusted release without a conventional malicious source change being approved. Build systems contain several forms of state, including workflow configuration, caches and artefacts. Their trust relationships need review just as carefully as the application code they produce.

What happened

TanStack's post-mortem describes an attack on 11 May 2026 that resulted in 84 malicious versions across 42 npm packages. The maintainers identified a chain involving a pull-request workflow, build-cache poisoning and the later release process. The response removed affected versions and changed workflow controls.

The package and version counts describe the identified malicious releases, not a confirmed number of compromised customers. Exposure for an individual organisation depends on the exact artefacts it installed or executed and the authority available to those processes.

Why the workflow timeline matters

The public report includes the initial malicious publication, community detection and subsequent removal activity. Those are separate milestones. A release can remain in a cache or a customer's environment after it disappears from the public registry.

For a consumer, the investigation needs to connect the supplier's timeline with local installations and builds. For a maintainer, it also needs to explain how state introduced during one job was accepted by a later job with greater authority.

Build state is part of the security boundary

Untrusted pull-request builds are useful for checking proposed changes. Their inputs are intentionally supplied by people who may have no trusted relationship with the project. The workflow must preserve that distinction when it runs code, stores results or shares state.

Build-cache contamination is dangerous because a cache can appear to be an efficiency feature rather than a distribution mechanism. If a privileged job accepts cached output influenced by an untrusted job, the cache can carry the attack across a boundary that source review does not directly examine.

The same question applies to artefacts and generated files. A release process should know whether an input came from reviewed source and an appropriately trusted build. Reusing an earlier output can be safe, but its provenance and integrity need to be part of the decision.

Workflow names and repository ownership are not sufficient evidence. A job running in the main repository may still execute code or accept data from an external contribution. The review needs to trace the exact inputs and permissions in each execution context.

Why release credentials make the difference

A malicious build result becomes more consequential when a later stage can sign or publish it. The authority at that stage may reach many users, even if the original untrusted job had little direct access. Separation only works if the receiving stage verifies what crosses into it.

Approval should therefore relate to the artefact actually published. A maintainer may approve a source change while the release process consumes different cached or generated content. The evidence needs to connect source, build state, artefact and publication in one understandable chain.

Consumers have a related responsibility. A recognised package name or automated dependency update does not establish that every new release is safe. They need traceability about installed artefacts and constraints on the environments that execute them.

Incident response should follow both directions. Maintainers need to remove malicious releases and repair the producing workflow. Consumers need to assess execution and reachable credentials. Neither side can complete the other's work simply by announcing that the public package has been removed.

How penetration testers assess comparable pipelines

An authorised review should map jobs according to the trust of their inputs and the authority they receive. Include workflow triggers, checked-out code, reusable actions, caches and artefacts. The purpose is to identify where a lower-trust input is accepted by a higher-trust stage.

Use harmless controlled markers in a test repository to assess whether state from an untrusted contribution can influence a release-like job. The exercise should avoid real publishing credentials and public package distribution. A safe demonstration can still establish the boundary failure clearly.

Review the approval process against the resulting artefact. Testers can compare the reviewed source revision with the content and provenance of the output. A useful finding identifies a mismatch or an unverified input, rather than merely recommending more code review.

Detection testing should include unusual workflow changes, unexpected publishing events and deletion of relevant records. The response team should be able to identify which job and source produced a release, including the state that influenced it.

How to reduce the risk

Separate untrusted contribution processing from release authority and from state trusted by releases. Design cache and artefact boundaries so untrusted jobs cannot supply inputs that privileged jobs accept without appropriate validation. Review the default behaviour of the actual automation platform.

Minimise workflow permissions and scope credentials to specific tasks. A job checking an external contribution should not inherit publishing or repository-administration authority merely because it runs within the project's automation environment.

Build releases from known reviewed inputs and retain evidence connecting the artefact to those inputs. Where state is reused, document why it is trusted and how its integrity is checked. A reproducible name or cache key is not the same as verified provenance.

Protect workflow changes according to their consequence. A small change in a build file can be as significant as a change in the application's authentication code. Ensure reviewers understand which identities, inputs and outputs the workflow controls.

For consumers, retain resolved package versions and build history, then limit the secrets available during installation and testing. If an affected artefact ran, rebuild the environment and investigate reachable authority rather than relying only on a dependency update.

Review the difference between a successful build and a trusted build. A workflow may complete all expected checks while consuming state produced in a different trust context. The security question is who could influence that state and whether the release job validates its origin before using it. Passing tests does not answer that question.

A controlled exercise can place a harmless marker in an untrusted test workflow and observe whether it reaches a privileged release stage. Record the expected boundary before running the exercise, and avoid using real release credentials. If the marker crosses, investigate the transfer mechanism and the approval decision. The result gives the team a concrete dependency to remove or verify rather than a broad instruction to make the pipeline more secure.

A practical build review

Choose one release and identify every input it accepted that did not come directly from the reviewed source revision. Include caches, artefacts, generated files and external actions. Ask what prevents each input from being influenced by an untrusted contributor.

Any answer based only on convention or an assumption about where a job runs deserves closer examination. The useful outcome is a release process whose trust decisions can be demonstrated, so performance optimisations and automation convenience do not become hidden routes to public publishing authority.

References

<https://tanstack.com/blog/npm-supply-chain-compromise-postmortem>

Read about our methodology or contact pentested.com to discuss security testing for your organisation.

See your first test report this week.

Book a 30 minute demo. We will verify one of your targets with you and run a test against it, so you can judge the results on your own systems.

Book a demo