Your CI Pipeline Is Production

Open your release workflow and read what one job is allowed to do. It can publish to your package registry, assume a cloud role, write to the repository and put new code in front of every user you have. Few production services hold that much authority in one place. Now ask who owns that job, who reviews changes to it, and who gets paged when it behaves strangely.
If those answers come slowly, you are running a production system without treating it as one. A pipeline holding publish or deploy rights owes you the same change control, input handling and credential discipline as any service on the internet. CISA and NSA published joint guidance on defending CI/CD in June 2023, and OWASP keeps a Top 10 CI/CD Security Risks, so this is not a fringe view.
The one-control fix does not hold
The obvious response is to pick a control and call the pipeline hardened. Pin the actions. Set the token to read-only. Move to OIDC so there is no stored secret to steal. All three are right, and the TanStack compromise of May 2026 shows why none is enough alone.
TanStack's postmortem says its pull_request_target workflows "had not been audited". Code from a fork pull request wrote into the pnpm store, and the later release workflow restored that cache. The attacker then read the OIDC token from runner memory, where the runner mints it "lazily, in memory, when id-token: write is set", and published to npm directly, bypassing the workflow's publish step. The result was 84 malicious versions across 42 packages.
Pinning would not have touched it, because the malicious code came from the pull request and not from a moved tag. TanStack notes that permissions: contents: read does not block cache writes. OIDC removed the stored secret and left a token worth reading from memory. Nx dropped npm tokens for trusted publishing after its August 2025 incident, which is the right fix for a stolen token, and TanStack shows what that fix leaves open. The postmortem also calls this "the same memory-extraction technique" used against tj-actions/changed-files in March 2025. Pipeline attacks get reused, so your defence cannot be a response to the last one.
Ask what you would ask of a service
Stop listing controls and ask the questions you already ask of any production service. Each maps onto something concrete in a pipeline.
| Production question | What it means in CI | Public case |
|---|---|---|
| What code is running, and who can change it? | A uses: tag runs whatever it points at today | tj-actions/changed-files, March 2025 |
| Who can send input to privileged code? | pull_request_target with a fork checkout or an interpolated PR title | Nx, August 2025; TanStack, May 2026 |
| What state crosses a trust boundary? | A cache written by an unprivileged job and restored by a release job | TanStack, May 2026 |
| How long does a stolen credential stay useful? | A stored token works until someone rotates it | CircleCI, January 2023; tj-actions, March 2025; LiteLLM, March 2026, on its maintainers' working account |
GitHub's hardening guide warns that "a tag can be moved or deleted if a bad actor gains access to the repository storing the action", so a tag reference trusts whoever controls that repository today, not the code you reviewed. This has already happened: NVD's entry for CVE-2025-30066 records that tags v1 through v45.0.7 of tj-actions/changed-files "were modified by a threat actor to point at commit 0e58ed8". Pin to a full commit SHA, but know the limits: pinning freezes you on code that may later turn out vulnerable, so it needs automated update review, and it does nothing when a pinned action fetches unpinned content at runtime.
Input is where CI looks most like a web application. GitHub's Security Lab calls combining pull_request_target with an explicit checkout of an untrusted pull request "a dangerous practice that may lead to repository compromise". Nx's advisory describes the quieter version: a pull request title injected into such a workflow, which the team believes is how the attacker obtained the npm token. Treat a PR title the way you treat a query string. I would not ban the trigger, because labelling and commenting on fork pull requests are reasonable uses. Just never let its privilege meet untrusted code.
Shared state is the one I would check first. GitHub's events reference warns that running untrusted code on the pull_request_target trigger may lead to vulnerabilities that "include cache poisoning and granting unintended access to write privileges or secrets". You would not let an anonymous request write to the store your deploy reads from, and a cache reachable from a fork pull request is that store. TanStack's cleanup purged all cache entries and added repository owner guards.
Credentials set the size of the damage. CircleCI's breach came from malware on an engineer's laptop that stole a session, not from a bad workflow, and the provider still told all customers to rotate "their secrets, including OAuth tokens, Project API Tokens, SSH keys, and more". CISA's alert on tj-actions was blunter: "Rotate all identified secrets immediately as they should be considered compromised." In their working account, LiteLLM's maintainers said a publish token stored for CI was exposed to a compromised CI dependency. GitHub's answer is OIDC, to "stop storing these credentials as long-lived secrets". Take it, knowing it shortens a credential's life without narrowing who can reach it. So give publish rights to a job that does nothing except publish, with no restored cache and no third party steps beside it.
The reach is why this deserves production standards. GitHub said in May that a poisoned VS Code extension on an employee device led to the exfiltration of internal repositories, and it called the attacker's claim of about 3,800 repositories "directionally consistent with our investigation so far". It then named the extension as Nx Console and linked the breach to the TanStack attack, and Infosecurity Magazine reported that Nx's CEO confirmed the poisoned extension was theirs. Nx's postmortem supplies the middle link: a "credential-stealing payload that arrived through the TanStack supply-chain compromise" took a contributor's GitHub CLI token, and the attacker published the malicious version as that contributor. Nx is sure the token was taken, but says it has "not forensically established" which path the malware used to reach it on that machine. So a workflow in one open source project ended two hops later inside GitHub.
Where this stops applying
A private repository with no fork pull requests and no publish or deploy rights has far less exposure, and I would not harden it ahead of your real production gaps. The argument is strongest for open source projects and any CI holding credentials that reach users.
Try this on one repository
Pick the repository whose pipeline can publish or deploy. Read every uses: line in .github/workflows and note any that does not end in a full-length commit SHA.
Then write down, for the release job alone, what triggers it, which secrets it receives, whether it has id-token: write, which caches it restores and which other jobs can write those caches. Ask whether a fork pull request can influence anything on that page. Every yes is a production bug. Finally, time how long it would take to rotate every credential on the page tonight, because that is what CISA told tj-actions victims to do.
References
- CISA, Joint Guidance on Defending CI/CD Environments, 2023-06-28
- OWASP, Top 10 CI/CD Security Risks, Internet Archive snapshot, 2026-04-29
- GitHub Docs, Secure use reference, Internet Archive snapshot, 2026-06-09
- GitHub Docs, Events that trigger workflows, Internet Archive snapshot, 2026-06-16
- GitHub Security Lab, Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests, 2021-08-03
- NVD, CVE-2025-30066, 2025-03-15
- TanStack, npm supply chain compromise postmortem, 2026-05-11, updated 2026-05-15
- GitHub Security Advisory, GHSA-cxm3-wv7p-598c, 2025-08-27
- CircleCI, January 4, 2023 incident report, 2023-01-12
- CISA, Compromise of Third-Party GitHub Action, CVE-2025-30066, 2025-03-18, updated 2025-03-26
- BleepingComputer, GitHub confirms breach of 3,800 repos via malicious VSCode extension, Internet Archive snapshot, 2026-05-20, updated 2026-05-21
- Infosecurity Magazine, GitHub Breach Traced to Malicious 'Nx Console' VS Code Extension, 2026-05-21
- Nx, Postmortem: Nx Console v18.95.0 supply-chain compromise, 2026-05-21
