In this article
- Why the build pipeline is an attractive target
- Pin what runs, then limit what it can reach
- Control the dependencies your build pulls in
- Record what each build contains
- What the standards say
- What to check before you change a pipeline
- Summary of controls
- Which to pick?
- Frequently asked questions
- Is a version tag enough to trust an action?
- What is the first setting to change in GitHub Actions?
- Does an SBOM prevent dependency exploits?
- Which framework should a policy cite?
Securing CI/CD pipelines against dependency exploits means treating every third-party action, package and build script as code that can run with your secrets. A compromised dependency that executes inside a build can read environment variables, tokens and signing keys before any production check runs. The short answer for most teams: pin third-party actions to a full commit SHA, give the workflow token the least permission it needs, lock and review dependencies, and record what each build contains so you can tell quickly when something changes.
Why the build pipeline is an attractive target
A CI/CD pipeline sits between source code and production. It usually holds deploy credentials, cloud roles, package registry tokens and signing keys, and it runs code pulled in from outside the team on every commit. An attacker does not need to break into the production environment if they can change what runs during the build.
The public record has concrete examples. In March 2025 a widely used GitHub Action, tj-actions/changed-files, was compromised. The GitHub Security Advisory for the incident states that “Attackers retroactively modified multiple version tags to reference a malicious commit.” The advisory lists affected versions as 45.0.7 and earlier, with a fixed release at 46.0.0, and says the vulnerability was active between March 14 and March 15, 2025. The malicious code could expose secrets in workflow logs. Source: GitHub Security Advisory GHSA-mw4p-6x4p-x5m5, published March 22, 2025, accessed November 25, 2026.
Any workflow that refers to a mutable tag such as v3 trusts whoever can move that tag. A repository owner, a maintainer with a stolen token, or an attacker who gains write access can point the tag at new code, and every workflow that uses it runs the new code on the next trigger.
Pin what runs, then limit what it can reach
Two controls do most of the work. The first decides what code runs. The second decides what that code can touch.
For the first, GitHub’s security hardening guidance for Actions says: “Pin references to actions to a commit SHA in your workflow files.” A commit SHA is a fixed identifier for one version of the code, so a retargeted tag cannot change what your workflow executes. You still need to read the code you pin, and pinning means you must update the SHA on purpose when you want a new release. Dependabot and similar tools can open those update pull requests for you.
For the second, the same guidance says the GITHUB_TOKEN should be granted the minimum required permissions, and that “It’s good security practice to set the default permission for the GITHUB_TOKEN to read access only for repository contents.” Set the default to read-only at the organization or repository level, then grant write permissions per job only where a step needs them. A job that only runs tests does not need permission to write to the repository or to create releases.
Secrets need the same discipline. Use short-lived credentials from your cloud provider where you can, scope each secret to one environment, and avoid passing a production key to a job that runs on a pull request from a fork. If a step does not need a secret, the step should not see it.
Control the dependencies your build pulls in
Dependency exploits also arrive through package managers. A library in a build tool or a test helper can run install scripts or post-install hooks on the build machine. The practical controls are:
- Commit lockfiles and install from them with the exact versions recorded, rather than resolving new versions during each build.
- Review dependency changes in pull requests, including new transitive packages as well as the direct ones you chose.
- Disable install scripts where the package manager allows it, and allow them only for packages that need them.
- Run dependency review and vulnerability scanning on every pull request, and treat a new critical advisory as a release blocker until someone has assessed it.
These controls reduce exposure but do not remove it. A malicious version published by a trusted maintainer can pass review if nobody reads the diff. That is why the next layer matters: knowing exactly what went into a given build.
Record what each build contains
A software bill of materials (SBOM) is an inventory of the components in a build. When a new advisory appears, an SBOM lets you answer the question “which of our services include this package, at which version?” in minutes rather than days. Generate the SBOM in the pipeline, store it with the build artifact, and check it against new advisories on a schedule as well as on each release.
Provenance goes one step further. It records how an artifact was built: which source commit, which workflow, which builder. The SLSA framework describes levels of build integrity. Version 1.0 of the SLSA specification is now marked retired on the project site, which states that version 1.2 is the current version. Teams starting fresh should therefore reference the current SLSA version rather than copying examples written for 1.0.
What the standards say
Government and standards guidance points in the same direction. The NIST Secure Software Development Framework, NIST SP 800-218, was published in February 2022 as Version 1.1. It groups practices into four areas: prepare the organization, protect the software, produce well-secured software, and respond to vulnerabilities. NIST has also released an initial public draft of Revision 1, which describes Version 1.2 of the framework, dated December 17, 2025, with the public comment period closed on January 30, 2026. Check the NIST publications page for the final text before you cite it in a policy. Source: NIST SP 800-218, accessed November 25, 2026.
The federal background is Executive Order 14028, issued May 12, 2021, which set out federal expectations for software supply chain security. NIST’s own summary of the order is at NIST on Executive Order 14028, accessed November 25, 2026. If your company sells software to public bodies or operates under a regulator that references these frameworks, check with counsel which versions your contracts require.
What to check before you change a pipeline
- Which third-party actions and build plugins run in your workflows, and which ones use tags rather than commit SHAs.
- The default token permission for each repository and organization, and any job that requests write access it does not use.
- Which secrets are visible to pull requests from forks, and which environments require a manual approval.
- Whether lockfiles are committed and whether install scripts are enabled for each package manager.
- Whether an SBOM is produced for every release artifact and stored with it.
Summary of controls
| Control | Risk it reduces | Primary reference |
|---|---|---|
| Pin actions to a full commit SHA | Retargeted or overwritten tags | GitHub Actions security hardening guide |
| Read-only default GITHUB_TOKEN | Malicious step writing to the repository | GitHub Actions security hardening guide |
| Scoped, short-lived secrets | Secret theft from logs or from a compromised step | NIST SP 800-218 |
| Committed lockfiles and reviewed diffs | Silent dependency changes | NIST SP 800-218 |
| SBOM per release | Slow response to a new advisory | Executive Order 14028 context |
| Provenance (SLSA) | Unverifiable build origin | SLSA specification, current version |
Which to pick?
The order depends on the size of the team and the exposure of the pipeline. My pick for most teams is the same first step: pin actions and set the token to read-only, because both take an afternoon and close the most common route in the March 2025 incident. Those changes need no new tooling.
For a small team with one or two services, add lockfile review and a scheduled dependency scan. For a team that ships to customers or public sector buyers, add an SBOM for every release and a provenance attestation, and plan the work around the current framework versions. For a team with several pipelines across environments, centralize the reusable workflows so that one pinned version is reviewed once rather than copied into every repository.
Frequently asked questions
Is a version tag enough to trust an action?
No. A version tag is a movable pointer. Pin to a full commit SHA, and update it deliberately after you review the change.
What is the first setting to change in GitHub Actions?
Set the default workflow token permission to read-only, then grant write access job by job where it is needed.
Does an SBOM prevent dependency exploits?
No. An SBOM does not block an attack. It tells you quickly which builds include a vulnerable or compromised component, so the response starts sooner.
Which framework should a policy cite?
Cite NIST SP 800-218 and confirm the current version on the NIST publications page. The Version 1.2 text was a draft at the time of writing, so check whether it has been finalized before you reference it as final.



