CI/CD Pipeline Attacks
Attacks that turn the build-and-release path (SCM, CI servers, runners, scanners, artifact registries, developer workstations) into the execution point, harvesting the credentials it holds and shipping tampered artifacts downstream with legitimate authority.
How it works
The pipeline is a high-frequency, highly privileged code-execution primitive: anything that runs inside a job inherits the job’s role, environment variables, mounted credential files and deploy rights. OWASP’s Top 10 CI/CD Security Risks frames the attack surface:
| ID | Risk | Attacker angle |
|---|---|---|
| CICD-SEC-1 | Insufficient flow control | push/merge to protected branch or release without review |
| CICD-SEC-2 | Inadequate IAM | stale/overprivileged human and machine identities |
| CICD-SEC-3 | Dependency chain abuse | Dependency Confusion, Typosquatting, Malicious Packages executing on runners |
| CICD-SEC-4 | Poisoned Pipeline Execution (PPE) | modify pipeline config, scripts, tests or any file the build executes, gaining the job’s permissions |
| CICD-SEC-5 | Insufficient PBAC | one pipeline/stage can reach other pipelines’ secrets and environments |
| CICD-SEC-6 | Insufficient credential hygiene | secrets in code, logs, image layers, env vars; long-lived tokens |
| CICD-SEC-7 | Insecure system configuration | unpatched/EOL CI servers, exposed services, Docker socket mounts |
| CICD-SEC-8 | Ungoverned 3rd-party services | actions, plugins, apps with inherited org access |
| CICD-SEC-9 | Improper artifact integrity validation | unverified scripts/images pulled and run |
| CICD-SEC-10 | Insufficient logging | no audit across SCM, CI, registry |
GitGuardian’s point is that CICD-SEC-6 is the multiplier: a poisoned dependency or PPE is only as bad as the credentials the job can reach. Since 2025 worms (Shai-Hulud Worm, Miasma, ChainDrop) target runners directly; GitGuardian reports 59% of machines compromised in one early wave were CI/CD runners. Mercari’s Common Threat Matrix for CI/CD (ATT&CK-style) enumerates the post-foothold techniques: read credential files mounted in the job, access the secret manager from a pipeline triggered by a different repository, implant CI runner images for persistence, deploy modified container/function/VM images to production with stolen deploy credentials.
GitHub-specific vectors (workflow triggers, mutable action tags, GITHUB_TOKEN scope) are on GitHub Actions Security, Pwn Requests and tj-actions changed-files Compromise.
Techniques / payloads
Poisoned pipeline execution
- Direct PPE: commit to
.gitlab-ci.yml,Jenkinsfile, Makefile, test scripts or packagescriptsthat the pipeline runs. - GitLab incoming-email token → push to main: the “Email a new issue to this project” address embeds a
glimt-token that is account-wide, never expires, and is identical across every project the user can access. GitLab does not verify the sender. Swap-issue@for-merge-request@and attach a.patch; GitLab applies it to the source branch, and if the patch touches.gitlab-ci.ymland the owner’s role allows, the pipeline runs attacker code with access to CI secrets.
Hunt: grep repos/docs/help centers forincoming+project-id-glimt-XXXXXXXXXXXXXX-issue@incoming.gitlab.com # leaks token incoming+project-id-glimt-XXXXXXXXXXXXXX-merge-request@incoming.gitlab.com # + .patch attachment@incoming.gitlab.comwith a token before-issue; remediation is resetting the Incoming email token under Personal access tokens.
Compromising the CI server
- Jenkins (Wiz): present in over a third of cloud environments; 59% of those have instances with critical core vulns, >87% run EOL instances, 48% run on compute with highly privileged service accounts. Most compromises abuse misconfiguration not 0-days: exposed script console / build functionality for direct command execution (cryptojacking campaigns), secrets in plaintext or env vars, Docker socket mounted into builds, shared host namespaces. Agent compromise yields tokens/SSH keys and a pivot to the controller; controllers on cloud VMs are queried for IMDS credentials to reach the cloud control plane.
- Artifact registry: CVE-2026-82329 in JFrog Artifactory/JFrog Access lets an unauthenticated network attacker mint admin tokens via a “phantom” join key; exploited in the wild (fixed 7.161.20; affected branches include 7.161.0–7.161.19, 7.146.0–7.146.36). Admin on the registry = tamper with every downstream build.
- Build engine escapes (“Leaky Vessels”): runC CVE-2024-21626 (leaked fd → host filesystem) and BuildKit CVE-2024-23651/23652/23653 (mount race, host file deletion,
security.insecureentitlement abuse). A malicious Dockerfile or image in a shared build host escapes to the runner.
Tampering with tools the pipeline trusts
- Codecov Bash Uploader (2021): a cloud-storage credential exposed in a Docker image layer let attackers modify the uploader; one added Bash line shipped all CI environment variables to the attacker. Pipelines across thousands of orgs
curl | bash’d it from January to April 2021. Detected only when a customer compared the script’s SHA-256 against the published hash. - SolarWinds Orion (SUNBURST): attackers tested injection into the Orion build in October 2019, inserted SUNBURST about four months later, and shipped trojanized signed updates from March 26, 2020.
- TeamPCP cascade (2026): Trivy compromise (CVE-2026-33634 / GHSA-69fq-xp46-6x23, exposure window March 19–23, 2026) via forced tag swaps; LiteLLM ran Trivy unpinned in CI, so the scanner stole LiteLLM’s publishing credentials → litellm 1.82.7/1.82.8 on PyPI → telnyx 4.87.1/4.87.2. Same crew overwrote Docker Hub tags on
checkmarx/kics(v2.1.20,alpine, newv2.1.21) with a KICS binary that encrypted and exfiltrated scan reports (IaC often holds secrets), trojanized Checkmarx VS Code/Open VSX extensions (ast-results2.53,cx-dev-assist) that fetchedmcpAddon.js, then published a malicious Checkmarx Jenkins AST plugin to the Jenkins Marketplace (last good 2.0.13-829.vc72453fa_1c16) using credentials from the earlier breach. Lesson: incomplete rotation after the first incident enabled the second. - Build-time execution in packages: crates.io
arrayref0.3.10,internment0.8.7,append-only-vec0.1.9 (compromised maintainer) added the typosquat dependencyproc-macro1, whosebuild.rsdownloaded and ran a payload at compile time: no crate code had to be called.proc-macro1was live for 107 minutes. Sleeper Ruby gems (knot-date-utils-rb,knot-simple-formatter) and Go modules (github.com/BufferZoneCorp/log-core,.../go-envconfig) targeted CI to steal credentials, tamper with GitHub Actions and add SSH persistence.
Developer workstation as pipeline entry point
Developer machines hold the same tokens as CI (.env, shell history, cloud profiles, CLI caches, MCP configs) and sit outside most EDR/proxy visibility.
- Trojanized Nx Console VS Code extension led to exfiltration of GitHub’s internal repositories.
- Cursor marketplace “Claude Code” extension: a stolen Fireworks AI vendor key gave access to Cursor storage; attackers shipped a malicious extension build (~5,000 potential installs) that planted an SSH backdoor.
- Leaked publisher tokens (Wiz): >550 validated secrets leaked by VS Code/Open VSX publishers, including >100 tokens granting extension update rights, enough to push malware to hundreds of thousands of installs.
- GlassWorm: 73 further fake Open VSX extensions with benign initial code and bundled native binaries acting as loaders.
Defenses
- Treat CI identity as production identity: short-lived OIDC-federated credentials, per-pipeline/per-stage scoping, CI (build) must not hold CD (deploy) credentials; don’t put secrets in env vars where avoidable; rotate on any suspicion, including secrets reachable via CI OIDC trust.
- Pin everything the job executes by digest/SHA (actions, scanner images, uploader scripts) and verify hashes/signatures before running; see SBOM and Provenance.
- Protect pipeline-definition files with CODEOWNERS/required review; require reviewers on publish environments; never expose signing certs to manually dispatched workflows.
- Patch and inventory CI servers and registries; never mount the Docker socket into builds; isolate runners (ephemeral, no shared namespaces).
- Treat IDE extensions as dependencies: allowlist/internal marketplace, disable auto-update; VS Code 1.123 adds a two-hour update delay (trusted publishers exempt). Apply cooldowns/minimum-age policies to packages too.
- Centralize audit logs across SCM, CI, registry; hunt for
.gitlab-ci.yml/workflow changes and pipeline runs nobody remembers. - Scan for credentials in repos, logs and image layers (Secret Scanning); the Codecov root cause was a credential in an image layer.
Related
- Software Supply Chain Security
- GitHub Actions Security · Pwn Requests · tj-actions changed-files Compromise
- Malicious Packages · Shai-Hulud Worm · XZ Utils Backdoor
- SBOM and Provenance
- Secret Scanning · Leaked Cloud Credentials · Vaults and Secret Stores
- Cloud Metadata Service Exploitation
- AI Coding Assistant Risks
Sources
- OWASP Top 10 CI/CD Security Risks Explained · original
- Common Threat Matrix for CI/CD Pipeline · original
- The Jenkins Threat Landscape · original
- Send GitLab an email, push to main · original
- Attackers Exploit Critical JFrog Artifactory Flaw to Mint Admin Tokens · original
- Leaky Vessels: runC and BuildKit container escape vulnerabilities · original
- Supply Chain Attack: How Attackers Weaponize Software · original
- SolarWinds Supply Chain Attack (Fortinet) · original
- Trivy Supply-Chain Attack: Trusted Scanner Compromised · original
- Inside the TeamPCP cascading supply chain attack · original
- Malicious KICS Docker Images and VS Code Extensions Hit Checkmarx · original
- TeamPCP Compromises Checkmarx Jenkins AST Plugin · original
- Rust Supply Chain Attack Puts Build-Time Malware in Crates · original
- Poisoned Ruby Gems and Go Modules Exploit CI Pipelines · original
- GitHub says internal repositories were taken in poisoned VS Code extension attack · original
- Cursor Says Stolen Fireworks AI Key Led to Trojanized Claude Code Extension · original
- Dismantling a Critical Supply Chain Risk in VSCode Extension Marketplaces · original
- More fake extensions linked to GlassWorm found in Open VSX · original
- VS Code 1.123 Adds Two-Hour Extension Update Delay · original