Calendar Icon White
December 5, 2026
Clock Icon
9
 min read

Software Supply Chain Security: A Practical Guide

Software supply chain security explained with real npm, PyPI and GitHub Actions attacks, and the lockfile, pinning, malware and SBOM controls that stop them.

Software Supply Chain Security: A Practical Guide
ChatGPT
Perplexity
Grok
Google AI
Claude
Summarize and analyze this article with:

TL;DR

Software supply chain security means knowing every package, build tool and pipeline that goes into your software, and stopping a compromised one before it ships. In practice that comes down to five controls: enforced lockfiles, malware detection on every package, pinned CI actions, short-lived publishing tokens and a continuously checked inventory of what you run.

This guide walks through the attacks that shaped the field in 2024 and 2025, each linked to its primary source, then the controls that would have stopped them, with commands you can run today. It is written by Strac, a Y Combinator-backed data security company trusted by enterprises, which runs dependency scanning, secret scanning and cloud checks in one platform.

✨ Software supply chain security in one picture

Your software supply chain is everything you did not write but still ship: open-source packages and the packages they pull in, container base images, GitHub Actions, build tools, and the registries and accounts that publish them. Attackers have learned that compromising one popular link reaches thousands of companies at once. Every recent incident fits one of four paths:

Four supply chain attack paths: look-alike packages, hijacked maintainers, compromised CI/CD and long-game insiders

Notice what is missing: a vulnerability. All four paths involve code that is malicious on purpose, so there is no CVE for a scanner to match until someone reports it. That is why software supply chain security needs more than the vulnerability scanning most teams already run. Our guide to software composition analysis covers the vulnerability side in depth.

Supply chain security incidents that changed the field

A few incidents in the last two years show each attack path in action. Every row links to the primary source.

WhenIncidentPathWhat it did
Mar 2024xz Utils backdoor (CVE-2024-3094)Long-game insiderA contributor who earned maintainer trust over years shipped a backdoor in the compression library
Dec 2024Ultralytics on PyPICompromised CI/CDA GitHub Actions compromise led to a stolen PyPI token and releases carrying a crypto miner
Mar 2025tj-actions/changed-files (CVE-2025-30066)Compromised CI/CDRepository tags were moved to malicious code that exposed secrets in workflow logs
Sep 2025Shai-Hulud npm wormHijacked maintainersA self-replicating worm compromised more than 500 npm packages and stole tokens and secrets

The tj-actions incident is the clearest lesson for CI. Thousands of workflows referenced the action by a tag such as @v45. When the tag was moved to a malicious commit, every one of those workflows ran the new code on its next build. Workflows pinned to a full commit SHA were unaffected.

✨ npm malware: how malicious packages work

npm malware rarely looks like malware. It is usually a normal package with one extra file and one extra line in package.json: an install script that runs automatically the moment the package is installed, with the full access of whoever ran npm install. On a developer laptop that means SSH keys, cloud credentials and npm tokens. In CI it means every secret the pipeline holds.

How an npm worm spreads: install, run, steal, spread

The 2025 worm added one twist: it used stolen npm tokens to publish infected versions of other packages the victim maintained, so it spread without any further attacker effort. You can see which packages in your tree run install scripts today:

# list every dependency that declares an install-time script
npm query ":attr(scripts, [preinstall]), :attr(scripts, [install]), :attr(scripts, [postinstall])" \
  | jq -r '.[] | "\(.name)@\(.version)"'

# install without running any lifecycle scripts (then allow-list the few you need)
npm ci --ignore-scripts

AI coding agents add a new source of risk. Agents install packages on a developer's behalf and occasionally invent package names that do not exist, which attackers can register. We cover that and the look-alike problem in our guide to detecting malicious npm and PyPI packages.

Would you know within the hour if a package you use was hijacked?

Book a demo of Strac's supply chain scanning  ·  Run a free security scan

Control 1: lockfiles and reproducible installs

A lockfile records the exact version and integrity hash of every package in your tree, including transitive ones. Committing it, and installing from it, means a newly published malicious version cannot slip into a build just because it matches a version range.

EcosystemLockfileInstall exactly from it
npmpackage-lock.jsonnpm ci
pnpmpnpm-lock.yamlpnpm install --frozen-lockfile
Yarnyarn.lockyarn install --immutable
Python (pip)requirements.txt with hashespip install --require-hashes -r requirements.txt
Poetry / uvpoetry.lock / uv.lockpoetry sync / uv sync --locked
Gogo.sumgo mod verify

Pair it with a cooling-off period. Most hijacked releases are found and pulled within days, so waiting before adopting brand-new versions removes a large share of the risk at almost no cost. Most dependency update bots can be configured to wait a set number of days after a release before proposing it.

Control 2: pin CI actions and lock down tokens

Treat your pipeline as part of the supply chain, because it is. Pin third-party actions to a full commit SHA, give the workflow token the least permission it needs, and prefer short-lived credentials over long-lived secrets:

permissions:
  contents: read          # default the GITHUB_TOKEN to read-only

steps:
  # pinned to a commit SHA, with the version in a comment for humans
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

On the publishing side, GitHub announced a plan for a more secure npm supply chain after the 2025 attacks: trusted publishing from CI, publishing tokens that expire, and mandatory two-factor authentication for local publishing. If you maintain packages, move to trusted publishing. The SLSA framework and OpenSSF Scorecard are useful yardsticks for both your own builds and the projects you depend on.

✨ Control 3: detect malicious packages, not only vulnerabilities

A vulnerability scanner asks whether a package version has a known flaw. A malware check asks whether the package itself is hostile. You need both, and you need the second one to run continuously, because a package that was clean when you installed it can be reported as malicious tomorrow. This is what that looks like in Strac: the dependency chain, how serious it is, and the fix in one click.

Strac dependency finding showing a critical, actively exploited package, the chain that pulls it in, and an Open fix PR button

Strac reads every lockfile in your GitHub or GitLab repos, builds an inventory of every direct and transitive package, and checks it against vulnerability and malware databases. When a new advisory or malware report lands, it is matched against that inventory without rescanning, so you learn whether you are affected in seconds. Look-alike package names are flagged too. Fixes come as a pull request with the smallest safe upgrade. See how Strac's SCA works.

Control 4: assume a token will leak, and find it first

Every supply chain attack in the table above was ultimately after credentials. The best defense is to have fewer of them lying around. Strac's secret scanning searches every file and the full git history of every repo for API keys and tokens, checks with a read-only call whether each one still works, and fails pull requests that add new ones. Because Strac is a data security company first, its DLP also finds the same keys pasted into Slack, Google Drive and AI chats, places a git-only scanner cannot follow. If a bad package did run on a machine, rotate every token it could have read, starting with npm, GitHub and cloud keys.

✨ Control 5: an SBOM you actually use

A software bill of materials is the inventory that makes incident response fast. When the next worm hits the news, the question is always the same: do we run any affected version, anywhere? Teams with a current SBOM answer in minutes. Teams without one grep through repos for a day. Our SBOM guide covers formats and how to generate one from lockfiles, and Strac exports CycloneDX and SPDX on demand.

Six supply chain security controls: lockfiles, malware detection, pinned CI actions, short-lived tokens, secret scanning and SBOM matching

Container images are part of the supply chain

Every FROM line pulls in an operating system's worth of packages you did not choose. Treat base images like dependencies: pin them by digest so a re-tagged image cannot change under you, prefer slim or minimal bases with fewer packages to patch, and rebuild on a schedule so security fixes actually reach production.

# look up the digest behind a tag
docker buildx imagetools inspect node:22-slim

# Dockerfile: pin by digest, keep the tag in a comment for humans
FROM node:22-slim@sha256:<digest-from-the-command-above>  # node:22-slim

Inside the image, the same lockfile rules apply: copy the lockfile first and install with npm ci or its equivalent, never a bare install that can resolve new versions at build time.

What to do when a package you use is compromised

When the next incident hits the news, work through the same five steps every time:

  1. Scope it. Find every repo and version affected. With a package inventory this is a search, not a project.
  2. Check the window. A bad version only matters if it was installed while it was live. Lockfile history shows when it arrived.
  3. Rotate. Assume every secret on any machine or CI runner that installed it is stolen: npm, GitHub, cloud and database credentials first.
  4. Rebuild clean. Pin a known-good version, reinstall from the lockfile and redeploy.
  5. Record it. Write down what was affected and what you did. Auditors and customers will ask.
# when did this package enter (or leave) the lockfile?
git log -S 'compromised-package' --oneline -- package-lock.json

✨ Supply chain security for a growing team: where to start

You do not need a dedicated team to cover most of the risk. A realistic first month looks like this:

  1. Week 1. Commit lockfiles everywhere and switch CI to npm ci or its equivalent.
  2. Week 2. Pin third-party GitHub Actions to SHAs and set workflow permissions to read-only by default.
  3. Week 3. Turn on dependency and malware scanning across every repo, and secret scanning across full history.
  4. Week 4. Rotate any live secrets found, write the fix deadlines into your vulnerability management policy, and generate your first SBOM.

A quick way to see where you stand is Strac's free scan: connect GitHub, pick up to 10 repos, and get a report of leaked secrets and vulnerable or malicious packages.

Strac free scan report: leaked secrets, vulnerable packages and malicious packages across five repos

How auditors and customers look at your supply chain

Supply chain questions now show up in every enterprise security questionnaire: do you scan dependencies, how fast do you patch, can you provide an SBOM, how do you secure CI. SOC 2 touches the same ground through vulnerability detection (CC7.1), change management (CC8.1) and vendor risk (CC9.2), as covered in our SOC 2 controls guide. With Strac, dependency fixes, secret rotations and cloud checks are saved as SOC 2, ISO 27001 and HIPAA evidence automatically, in the same platform as compliance automation and the AI pen test, so the answers to those questionnaires are already written down. For a comparison of tools in this space, see our roundup of the best SCA tools, and for how it all fits together, our guide to application security posture management.

One practical tip: keep a short written description of your supply chain controls, covering lockfiles, pinned actions, scanning, token policy and incident steps. It answers half of every vendor questionnaire, and it doubles as the onboarding document for the next engineer who touches CI.

See every package you ship, and every one that should not be there.

Book a demo of Strac's software supply chain security  ·  Run a free security scan

🌶️ Spicy FAQs about software supply chain security

What is software supply chain security?

Software supply chain security is protecting everything that goes into your software besides the code your team writes: open-source packages, build tools, CI/CD pipelines, container images and the accounts that publish them. The goal is to know every component you ship and to stop a compromised one before it reaches production.

What is an example of a software supply chain attack?

In September 2025 a self-replicating worm known as Shai-Hulud compromised more than 500 npm packages, according to CISA. Each infected package stole tokens from the machine that installed it and used them to publish infected versions of more packages.

How do I protect against npm malware?

Commit and enforce lockfiles, install with npm ci, block install scripts where you can, wait before adopting brand-new versions, and run a scanner that checks every package against a malware feed, not only a vulnerability database. Rotate any token exposed on a machine that installed a bad package.

Is an SBOM enough for supply chain security?

No. An SBOM is an inventory: it tells you what you ship. It does not block a malicious package or fix a vulnerable one. It becomes valuable when it is kept current and checked continuously against new advisories.

Does SOC 2 cover software supply chain security?

Indirectly. SOC 2 asks you to detect vulnerabilities (CC7.1), manage changes (CC8.1) and manage vendor risk (CC9.2). Open-source dependencies and CI tools fall under all three, and auditors increasingly ask how you vet them.

Customer story

“Don’t just alert on problems, fix them.”

Scott Roberts, Chief Information Security Officer, UiPath

  • UiPath
  • Crypto.com
  • Inmar Intelligence
  • thredUP
  • Paymentology
  • Enveda
  • Genesis Molecular AI
  • MeridianLink
More customer stories →
What is software supply chain security?
What is an example of a software supply chain attack?
How do I protect against npm malware?
Is an SBOM enough for supply chain security?
Does SOC 2 cover software supply chain security?
Discover & Protect Data on SaaS, AI, MCP, Endpoints & Cloud
Strac provides end-to-end data loss prevention for all SaaS and Cloud apps. Integrate in under 10 minutes and experience the benefits of live DLP scanning, live redaction, and a fortified SaaS environment.
Get compliant from $4,995

Latest articles

Browse all

Get Your Datasheet

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Close Icon