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:

IDRiskAttacker angle
CICD-SEC-1Insufficient flow controlpush/merge to protected branch or release without review
CICD-SEC-2Inadequate IAMstale/overprivileged human and machine identities
CICD-SEC-3Dependency chain abuseDependency Confusion, Typosquatting, Malicious Packages executing on runners
CICD-SEC-4Poisoned Pipeline Execution (PPE)modify pipeline config, scripts, tests or any file the build executes, gaining the job’s permissions
CICD-SEC-5Insufficient PBACone pipeline/stage can reach other pipelines’ secrets and environments
CICD-SEC-6Insufficient credential hygienesecrets in code, logs, image layers, env vars; long-lived tokens
CICD-SEC-7Insecure system configurationunpatched/EOL CI servers, exposed services, Docker socket mounts
CICD-SEC-8Ungoverned 3rd-party servicesactions, plugins, apps with inherited org access
CICD-SEC-9Improper artifact integrity validationunverified scripts/images pulled and run
CICD-SEC-10Insufficient loggingno 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 package scripts that 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.yml and the owner’s role allows, the pipeline runs attacker code with access to CI secrets.
    incoming+project-id-glimt-XXXXXXXXXXXXXX-issue@incoming.gitlab.com          # leaks token
    incoming+project-id-glimt-XXXXXXXXXXXXXX-merge-request@incoming.gitlab.com  # + .patch attachment
    
    Hunt: grep repos/docs/help centers for @incoming.gitlab.com with 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.insecure entitlement 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, new v2.1.21) with a KICS binary that encrypted and exfiltrated scan reports (IaC often holds secrets), trojanized Checkmarx VS Code/Open VSX extensions (ast-results 2.53, cx-dev-assist) that fetched mcpAddon.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 arrayref 0.3.10, internment 0.8.7, append-only-vec 0.1.9 (compromised maintainer) added the typosquat dependency proc-macro1, whose build.rs downloaded and ran a payload at compile time: no crate code had to be called. proc-macro1 was 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.

Sources