Software supply chain: would a poisoned package or action reach production?

This month, make new package versions wait three days before they install, lock every GitHub Action to a commit and replace long-lived publishing and cloud tokens with trusted publishing and OIDC. Judge every other control by whether it keeps credentials away from code you didn't write, or tells you within an hour where a bad version ran.

Reviewed
Next review
Version
1.2
Written for
Development, platform and DevOps teams that build and ship software, including small teams on GitHub

If you only do five things

Third parties, including flaws in vendor software, were involved in 48% of the breaches in Verizon's 2026 DBIR, up 60% in a year1.

  1. Make new versions wait three days.

    Poisoned releases are often caught within hours: PyPI quarantined the LiteLLM and Telnyx ones within four hours of upload2. Dependabot waits three days by default and pnpm one day34; set npm's min-release-age=35 and a P3D cooldown in uv or pip2. CISA suggested seven days after the axios compromise6.

  2. Block install scripts and install from the lockfile.

    Shai-Hulud 2.0 ran from a preinstall script, before any test or security check7. npm 12 blocks dependency install scripts by default and pnpm runs only approved ones89; approve the few that need it with npm approve-scripts8. On older npm set ignore-scripts=true6. Commit lockfiles with hashes2 and install with npm ci.

  3. Lock every action to a commit.

    In March 2026 an attacker force-pushed 76 of 77 version tags of trivy-action to code that read secrets from runner memory12. Turn on Require actions to be pinned to a full-length commit SHA, which a workflow lockfile satisfies, and set Workflow permissions to read-only13.

  4. Publish and deploy without long-lived tokens.

    GitHub calls removing long-lived credentials from CI/CD the number one thing you can do14. Publish to npm and PyPI with trusted publishing152, set npm's Require two-factor authentication and disallow tokens15, delete the old tokens and deploy to clouds with OIDC16. Require phishing-resistant MFA on developer accounts6.

  5. Record what every build contained.

    Generate an SBOM in the build for each release and keep it with the artifact1718, so you can tell within an hour whether you shipped a bad version. The CRA requires one from December 202719.

When a package or action you use is reported compromised

  1. Did a bad version run anywhere?

    Search lockfiles, caches and artifact registries, then CI pipelines and developer machines that installed packages in the exposure window6. OSV-Scanner checks lockfiles and SBOMs against OSV.dev10, which includes OpenSSF's malicious-package (MAL-) records11.

  2. Is the machine still infected?

    Isolate it before you revoke anything: Mini Shai-Hulud wipes the home directory if its GitHub token is revoked20. Shai-Hulud 2.0 registered a GitHub Actions runner called SHA1Hulud on infected hosts7. Remove persistence and rogue runners, or rebuild.

  3. Which secrets could it reach?

    Rotate every secret the job or machine could read, as CISA advises for a compromised CI run6, and do it in one go: the Trivy attacker may have kept access because an earlier rotation wasn't atomic12.

  4. What did the attacker do with them?

    Look for new repositories (Trivy's payload created tpcp-docs- ones12), workflow commits by automated accounts21, versions you didn't publish and unusual cloud API calls.

  5. Do you have to report it?

    If malicious code could have reached a product you place on the EU market, treat it as a possible severe CRA incident, with an early warning due within 24 hours19. The EU security laws sheet has the other clocks.

If you place software on the EU market: the CRA

  • Reporting applies now. Since 11 September 2026, manufacturers must report actively exploited vulnerabilities and severe incidents, also for products placed on the market before the rest of the CRA applies on 11 December 202719.
  • A poisoned release counts. An incident that has led or could lead to malicious code in your product or your users' systems is severe, such as malicious code in your update channel19.
  • The SBOM must be machine-readable, not public. It needs a commonly used format, must cover at least top-level dependencies and goes to authorities on request; sharing it with users is optional19. CISA's 2026 minimum elements add transitive dependencies, hashes and licenses17.
  • Vulnerability handling is due by December 2027. Have a disclosure policy, a reporting contact, free security updates and public notes on fixed flaws for at least 5 years, or the expected use time if shorter. Report flaws in components to their maintainers19.

What changed in 2026

  • Attacks moved into CI and release workflows. Trivy's compromise spread through retagged actions in March12. Mini Shai-Hulud scraped runner memory for identity tokens and swapped them for npm trusted-publisher tokens20. In May CISA reported that a poisoned VS Code extension update led to theft of GitHub's internal repositories21.
  • Safer defaults shipped. npm 12 blocks dependency install scripts and git and URL dependencies85, and since July Dependabot waits three days before version updates3.
  • GitHub Actions got lockfiles. Since 28 October, .github/workflows/actions.lock pins actions to commits on Free, Team and Enterprise Cloud plans, and a Require lockfile policy enforces it22.
  • npm is closing the token route. Stage-only tokens hold a release until a maintainer approves it with 2FA, and npm aims to end direct publishing with bypass-2FA tokens in January 202723.

What you can skip

  • Chasing unreachable CVEs deep in the tree. The CRA asks you to remediate in relation to the risks19. Fix exploited and reachable ones within the patching sheet's deadlines and batch the rest.
  • Polishing SBOMs nobody reads. Generate them in the build with tools you already have, as ENISA advises for a first implementation18. Buy an SBOM platform only when a customer or regulator consumes them.
  • SLSA Build L3 before the basics. Close the moving tags, long-lived tokens and install scripts behind most 2026 incidents first.
  • A registry proxy for a small team. A cooldown, a lockfile and blocked install scripts give most of its benefit without the upkeep.

Mistakes that cost the most

  • Publishing from a busy job. Malware in the same job can read the OIDC token from runner memory20. Publish from a separate job that installs nothing, in an environment that needs a reviewer's approval24.
  • Running fork code with secrets. pull_request_target workflows are privileged, bypass fork approval and must not check out untrusted code1613. From 2 December GitHub blocks them in public repositories by default26.
  • Forgetting developer machines. The poisoned Nx Console extension reached users through VS Code's automatic updates21. Allowlist extensions and pin approved versions with the AllowedExtensions policy25.

What this looks like at your size

Small team, no security staff

  • In the organization's Actions settings, set read-only workflow permissions and require SHA pinning.
  • Keep Dependabot's default cooldown and turn on its malware alerts, security updates and secret scanning (Secret Protection for private repos)28.
  • Move npm and PyPI publishing to trusted publishing (npm needs cloud-hosted runners for it15), and run npm 12 or current pnpm in CI.

Growing, with IT or security staff

  • Add .github/workflows to CODEOWNERS and turn on Require review from Code Owners (Team plan or higher for private repos)27.
  • Publish from an environment with required reviewers and Prevent self-review (public repositories only on Free, Pro and Team)24.
  • Run OSV-Scanner on lockfiles in every pull request.

Enterprise or regulated

  • Route installs through a registry proxy that enforces a cooldown and checks for malware.
  • Verify GitHub artifact attestations before deploy; private repos need Enterprise Cloud28.
  • Keep each release's SBOM for 10 years or the support period, if longer19, and add build pipeline compromises to your CRA reporting path.