Join our Newsletter — 33% off our NHI Course
Home› FAQ› Cyber Security› How does a CI/CD pipeline attack work?
Cyber Security

How does a CI/CD pipeline attack work?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 18, 2026 Domain: Cyber Security

A CI/CD pipeline attack compromises the build or deployment process so an attacker can alter code, inject secrets theft, or push malicious artefacts into production. Common entry points include stolen credentials, compromised build runners, insecure dependencies, and overly permissive automation. Defenders should protect pipeline identities, isolate runners, verify artefact provenance, and restrict deployment rights.

How a CI/CD Pipeline Attack Actually Unfolds

A CI/CD pipeline attack usually starts by taking control of something the pipeline already trusts: a developer credential, a build runner, a dependency feed, a workflow file, or a deployment token. Once inside, the attacker can change what gets built, what gets signed, or what gets deployed, turning automation into a delivery path for malicious code or secret theft.

The practical danger is that the pipeline often has more reach than any single developer workstation. If an attacker can alter the pipeline definition or the build environment, they may be able to slip in backdoored artifacts, read secrets during runtime, or poison release outputs without touching the source repository in an obvious way.

That is why CI/CD attacks are usually about trust abuse rather than a single exploit. A successful campaign often relies on stolen credentials, compromised third-party actions or plugins, weak branch protection, overly broad runner permissions, or unsafe handling of environment variables and artifacts.

Where the Attack Enters the Pipeline

The entry point determines the blast radius. Some attacks begin with a compromised maintainer account or leaked token, which lets an adversary modify workflow definitions or approve releases. Others begin with a malicious dependency, an unsafe build script, or a runner that can be reached from untrusted code and then used to collect credentials or alter outputs.

Pipeline identities matter because they are the operational actors that move code through the system. If a build job can publish artifacts, access package registries, sign releases, or deploy to production, then that identity needs strict scoping and short-lived authority. The CI/CD Pipeline Identity Security Guide covers the practical controls around federated auth, token permissions, pinned actions, and trusted publishing.

Dependencies are another common foothold. A compromised action, plugin, or package can run inside the pipeline’s trusted context and exfiltrate secrets, alter build output, or create a hidden persistence point that survives ordinary code review. Supply-chain attacks on pipeline components are especially effective because teams often trust the pipeline to validate what it is itself executing.

Why the Damage Spreads Beyond the Build

Once an attacker controls the pipeline, the impact extends far beyond one build job. They may steal signing keys, access tokens, cloud credentials, or service secrets, then reuse them to reach source control, registries, deployment targets, or production workloads. That is why a pipeline compromise is often also a secrets compromise and, in many cases, a release-integrity compromise.

Artifact integrity is the main control point after initial access. If the pipeline does not verify provenance, sign outputs, and separate trusted publishing from ordinary build execution, a malicious change can move from test to release with no obvious break in the process. The SLSA framework is useful here because it focuses on build provenance and artifact integrity, which are the core trust properties attackers try to undermine.

Real-world incidents show the pattern repeatedly: attackers steal a maintainer token, compromise a workflow, leak CI secrets, or abuse permissive automation to reach downstream systems. The lesson is not that CI/CD is uniquely fragile, but that it concentrates authority, so one weak link can affect many repositories, environments, and release paths at once.

Risk and Threat Considerations

CI/CD attacks are high-impact because they attack the control plane that produces software, not just the software itself. If an adversary can alter the pipeline or its credentials, they can turn trusted automation into a distribution mechanism for malware, secret theft, or unauthorized production changes.

Failure mechanism: The attacker abuses a trusted pipeline identity, dependency, or runner to inject code, steal secrets, or replace legitimate build output with tampered artifacts.

Impact: Organisations can lose code integrity, release integrity, and credential secrecy at the same time, which can lead to persistent compromise across multiple environments and releases.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

SLSA, NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
SLSASupply-chain Levels for Software ArtifactsCI/CD attacks target build provenance and artifact integrity.
Recommendation — Adopt provenance verification and signed build outputs before promotion.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementPipeline attacks often begin with stolen or overlong-lived credentials.
IA-9 — Identification and Authentication (Non-Organizational Users)CI/CD jobs, runners, and service identities authenticate to external services.
CM-5 — Access Restrictions for ChangeAttackers abuse pipeline change rights to modify workflows and release paths.
Recommendation — Rotate and scope pipeline credentials to the minimum needed lifetime and privilege. Authenticate pipeline-to-service interactions with tightly scoped machine credentials. Restrict who can change pipeline definitions, runners, and deployment rules.
OWASP ASVSV15 — Secure Coding and ArchitecturePipeline compromise turns build architecture into an attack path.
Recommendation — Design build and release architecture to separate untrusted execution from trusted promotion.

Practitioner Guidance

What to verify: Confirm which identities can build, approve, sign, and deploy, then check whether any of those identities have broader rights than the job actually needs. If a workflow can access production secrets or deployment permissions, treat that as a high-priority review item rather than a routine configuration detail.

Decision rule: If a pipeline component can execute untrusted code, isolate it from secret-bearing contexts and require artifact verification before promotion. If a compromise is suspected, rotate the affected tokens and signing material first, then assess whether any release or deployment outputs should be rebuilt from a clean environment.

Practitioner takeaway: The key question is not whether the pipeline can run builds, but whether every stage that can change software, secrets, or release state is tightly bounded, observable, and independently verifiable.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 18, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org