Guide, sources citedLast checked 16 October 2026 with AI-assisted research. Editor: Akshay Dubey.Corrections logEditorial policy
On this page
  1. Summary
  2. Timeline
  3. How it worked
  4. Downstream effects
  5. NHI root cause
  6. Mitigation playbook
  7. What Codecov changed
  8. FAQ
  9. Sources
Incident record: Codecov Bash Uploader, 2021
FieldRecord
Date disclosed15 April 2021 (Codecov security update; updated 29 April 2021)
Initial accessAn HMAC key extracted from an intermediate layer of a public Codecov Docker image, which Codecov attributes to an error in its Docker image creation process
Identity or credential involvedIdentity: a Google Cloud Storage service account. Credential: the HMAC key it held. Downstream: credentials, tokens and keys in the environment of customers' CI jobs
PrivilegesEnough to modify the Bash Uploader script held in Google Cloud Storage
Confirmed impactScript altered periodically from 31 January 2021 until a customer reported a checksum mismatch on 1 April 2021. Disclosed downstream: HashiCorp signing key exposed and replaced (no evidence of misuse found); Twilio, Rapid7 and monday.com reported access to repositories or source code
Reported, not confirmedHundreds of customer networks accessed (unnamed federal investigator, via Reuters, April 2021). Codecov has not confirmed this
Number affectedNot publicly disclosed
AttributionNot publicly attributed
Primary sourceCodecov post-mortem; Codecov security update

TL;DR

  • Codecov's Bash Uploader script, fetched and executed in customers' CI/CD pipelines, was altered by an unauthorised actor. Codecov's post-mortem says the actor extracted an HMAC key for a Google Cloud Storage service account from an intermediate layer of a Codecov Docker image and used it to change the script in Google Cloud Storage.
  • The alteration: one added line that sent the git remote URL and the output of env to a third-party server each time the script ran.
  • Codecov says the unauthorised alterations were periodic, from 31 January 2021 until a customer alerted it on 1 April 2021. Any credential, token or key passed through a CI runner that executed the altered script may have been exposed. The Codecov GitHub Action, CircleCI Orb and Bitrise Step used the Bash Uploader and were also affected.
  • Customer disclosures followed between 22 April and 17 May 2021: HashiCorp revoked and replaced the GPG key used to sign release hashes, and Twilio, Rapid7 and monday.com each disclosed limited access to repositories or source code. The total number of affected customers is not publicly disclosed.
  • Our mapping to the OWASP NHI Top 10 (2025), which is this site's interpretation and not a statement by OWASP or Codecov: NHI2 (Secret Leakage), NHI7 (Long-Lived Secrets), NHI3 (Vulnerable Third-Party NHI) and NHI5 (Overprivileged NHI).

Summary

Codecov sells code-coverage reporting to software teams. Its upload mechanism, the bash-uploader, was, at the time of the breach, fetched from codecov.io/bash at run time and executed inside customers' CI pipelines, usually after the test step. The script's job was to package coverage reports and POST them to Codecov's service, and because it ran inside the CI job, it had access to everything the job had access to, including every secret that had been injected into the job's environment.

Codecov attributes the intrusion to "an error in Codecov's Docker image creation process" that allowed the actor to extract the credential needed to modify the script. Its post-mortem specifies that the credential was an HMAC key for a Google Cloud Storage service account, taken from an intermediate layer of a Codecov Docker image, and that the actor used it to alter the Bash Uploader held in Google Cloud Storage. Codecov says the alterations were periodic and began on 31 January 2021. The added line sent the git remote URL and the environment variables to a third-party server. The Codecov GitHub Action, CircleCI Orb and Bitrise Step, which used the Bash Uploader, were also affected. The alteration was reported by a customer, not found by Codecov: on 1 April 2021 the customer noticed that the SHA-256 checksum of the downloaded script did not match the checksum published on GitHub.

The number of affected customers is not publicly disclosed. Codecov says it has not been able to determine conclusively who was responsible. Reuters reported on 16 April 2021 that Codecov said there was an ongoing federal investigation and that the intrusion affected an unknown number of its 29,000 customers. BleepingComputer, citing later Reuters reporting, said that according to an unnamed federal investigator hundreds of customer networks had been accessed. Codecov has not confirmed that figure.

Timeline

DateEvent
31 Jan 2021Per Codecov, periodic unauthorised alterations of the Bash Uploader begin.
31 Jan to 1 Apr 2021CI jobs that ran the altered script during the periods it was in place may have had their git remote URL and environment variables sent to a third-party server.
1 Apr 2021A Codecov customer notices that the script's SHA-256 checksum does not match the one published on GitHub and reports it. Codecov secures the script.
15 Apr 2021Codecov publishes its security update and emails affected users. The update says the matter was reported to law enforcement and refers to an ongoing federal investigation. Codecov does not name the agency.
22 Apr 2021HashiCorp publishes HCSEC-2021-12: the GPG key used to sign release hashes was exposed and has been revoked and replaced.
29 Apr 2021Codecov updates its advisory with further detail on the environment variables that may have been obtained and begins in-app notifications to affected organisations. CISA issues an alert on 30 April pointing users to the update.
4 May 2021Twilio discloses that a small number of customer email addresses had likely been exfiltrated.
13 May 2021Rapid7 discloses access to a small subset of source code repositories for internal MDR tooling.
17 May 2021monday.com files its Form F-1 with the SEC, which, as quoted by BleepingComputer, discloses access to a read-only copy of its source code.

How it worked

The attack chain was structurally simple. The interesting feature is how ordinary each step was:

  1. Credential exposure. Per Codecov's post-mortem, an intermediate layer of a Codecov Docker image contained an HMAC key for a Google Cloud Storage service account. Codecov describes this as an error in its Docker image creation process.
  2. Credential harvesting. The actor extracted the key from the image. Codecov says it has not been able to determine conclusively who the actor was.
  3. Script modification. The actor used the key to alter the Bash Uploader held in Google Cloud Storage, adding one line that sent the git remote URL and the output of env to a third-party server.
  4. Normal distribution. Pipelines that fetched the script from codecov.io/bash at run time received the altered version during the periods it was in place. The Codecov GitHub Action, CircleCI Orb and Bitrise Step used the same script.
  5. Per-run exfiltration. Each CI job that ran the altered script sent its environment to the third-party server. Codecov describes the exposure as any credentials, tokens or keys that customers were passing through their CI runner.
  6. Use of exposed credentials (in the disclosed cases). Twilio, Rapid7 and monday.com each disclosed that repositories or a copy of source code had been accessed. Access beyond the companies that disclosed is not publicly confirmed.

Downstream effects

Public disclosures by affected customers appeared between 22 April and 17 May 2021. Only companies that disclosed themselves, or that appear in an official filing, are named here.

  • HashiCorp (HCSEC-2021-12, 22 April 2021) said the GPG private key used to sign the hashes that validate HashiCorp product downloads had been exposed. It revoked and replaced the key and said its investigation had not revealed evidence of unauthorised use. Terraform verifies provider binaries against this key, so patched releases were issued. The case is instructive because a signing key's blast radius extends to every consumer of the artefacts it signs.
  • Rapid7 (13 May 2021) said a small subset of its source code repositories for internal tooling for its MDR service was accessed. The repositories contained some internal credentials, which Rapid7 said were all rotated, and alert-related data for a subset of MDR customers. Rapid7 said no other corporate systems or production environments were accessed.
  • Twilio (4 May 2021) said GitHub notified it on 22 April 2021 of suspicious activity related to an exposed Twilio user token and identified repositories cloned by the attacker. Twilio said "a small number of email addresses had likely been exfiltrated", that it rotated potentially exposed credentials, and that it had no indication other customer data was accessed.
  • monday.com disclosed the incident in the Form F-1 it filed with the SEC on 17 May 2021. As quoted by BleepingComputer, the filing says unauthorised actors accessed a read-only copy of its source code and a file containing a list of URLs pointing to publicly broadcast customer forms and views, and that it found no evidence of unauthorised modification of its source code.
  • The total number of affected customers is not publicly disclosed. Reuters reporting in April 2021, as relayed by BleepingComputer, cited an unnamed federal investigator as saying hundreds of customer networks had been accessed. Codecov has not confirmed that figure.

NHI root cause analysis

The mapping below is this site's interpretation against the OWASP Non-Human Identities Top 10 (2025). OWASP's list does not cite Codecov, and neither Codecov nor the affected companies have described the incident in these terms.

  • NHI2, Secret Leakage (primary): the incident began with a leaked secret at Codecov itself (a storage service account key left in a Docker image layer) and then leaked customers' secrets, because the altered script sent the CI environment to a third-party server.
  • NHI7, Long-Lived Secrets: static API keys, signing keys and access tokens stay usable after exfiltration until someone rotates them, which is why Codecov and CISA advised affected users to re-roll credentials. Short-lived credentials would have narrowed the window for reuse. The proportion of exposed secrets that were long-lived is not publicly disclosed.
  • NHI5, Overprivileged NHI: a CI token with broader scope than the job needs increases what an attacker can reach. Twilio disclosed that repositories were cloned following exposure of a user token. The scope of tokens exposed at other customers is not publicly disclosed.
  • NHI3, Vulnerable Third-Party NHI: from the customer's perspective, the uploader was third-party code running with the pipeline's credentials, which in our reading fits this category.
  • Supply-chain integrity (adjacent): pipelines that fetched and executed the script at run time without checking it against the published checksum received the altered version. The customer who did compare checksums is how the incident was detected.

Mitigation playbook

  1. Pin upstream artefacts by hash, not by name. Any curl | bash-style install should include a sha256sum verification step (or equivalent). For container-based tooling, pin by digest (@sha256:…), not by tag.
  2. Migrate CI secrets to short-lived, federated credentials. GitHub Actions OIDC → cloud provider, GitLab CI → Vault, and similar federation paths exchange a workload-bound OIDC token for a short-lived cloud credential that expires shortly after it is issued.
  3. Scope CI tokens tightly. Repo-level not org-level. Read where possible. Environment-specific where possible. Time-bound where possible.
  4. Avoid putting secrets in environment variables where an alternative exists. File-based secrets (with proper filesystem isolation) or runtime secret-manager calls expose secrets to a smaller process surface than the CI job's full environment.
  5. Monitor outbound from CI runners. CI jobs have predictable network patterns. Outbound traffic to unknown destinations is detectable if you're watching.
  6. Rotate static signing keys onto short-lived, attested signing paths. Keyless signing, as offered by sigstore, removes the need to hold a long-lived private signing key.
  7. Treat third-party tooling that runs in CI as privileged. Every tool fetched from the internet and executed inside your pipeline is a potential supply-chain entry point. Inventory them, pin them, and monitor the set.

What Codecov changed

Codecov's post-mortem lists the changes it made after the incident: the exposed key was revoked and all production keys were audited and rotated; publicly accessible Codecov Docker images were rebuilt using squashed or multistage builds; any change to the Bash Uploader now triggers alerts; and Codecov announced a new uploader shipped as a signed, checksum-verifiable binary, with the Bash Uploader to be deprecated.

Several of the controls in the playbook above became widely available in the same year. The dates are a matter of record, but we have found no primary source showing that the Codecov incident caused them:

  • sigstore was announced by the Linux Foundation on 9 March 2021, before the Codecov incident was disclosed.
  • SLSA (Supply-chain Levels for Software Artifacts) was introduced by Google on 16 June 2021. The announcement cites SolarWinds and Codecov as recent attacks and lists Codecov as its example of an artefact uploaded outside the CI/CD system using leaked credentials.
  • OpenID Connect support in GitHub Actions, which allows cloud deployments without stored long-lived cloud secrets, was announced on 27 October 2021.

On this site, Codecov is used as the reference case for secret leakage (NHI2) through a CI/CD pipeline.

Frequently asked questions

What was the Codecov bash uploader breach?

An attacker modified the Codecov Bash Uploader script, which ran inside customers' CI/CD pipelines, so that it sent the git remote URL and the environment variables of each CI job to a third-party server. Codecov says the alterations were periodic, from 31 January 2021 until a customer reported a checksum mismatch on 1 April 2021. Because CI/CD environments hold credentials for whatever a build touches, one upstream change exposed secrets at multiple organisations. The number of affected customers is not publicly disclosed.

Why is Codecov still cited as a case study?

Because it is a well documented example of CI/CD as a credential concentration point, with a vendor post-mortem and several customer disclosures on the public record. A build environment can hold cloud credentials, registry tokens, signing keys and deployment secrets at the same time. Anything executing in that environment has access to all of it.

What is the defence against a compromised build-time dependency?

Assume the pipeline will execute untrusted code and design so that this is survivable: short-lived credentials issued per job through workload identity federation rather than static secrets in environment variables, scoped narrowly to that job, and egress restrictions so exfiltration to an arbitrary endpoint fails. Verifying script integrity is worth doing but is a weaker control than removing the standing credentials.

How does the Codecov pattern relate to privilege escalation into the supply chain?

In the cases that were disclosed, exposed credentials were used to reach source code: Twilio, Rapid7 and monday.com each reported access to repositories or a copy of source code. HashiCorp replaced the GPG key that signs its release hashes after finding it had been exposed, and said it found no evidence of unauthorised use. No company that disclosed reported that the attacker published altered software. The escalation risk is that a build environment can hold signing keys and publishing tokens, so build-time access could become publish-time access. That is the reason to give CI/CD credentials short lifetimes and narrow scope.

Would your controls have changed the outcome? The breach readiness score asks you to rate your own controls against seven publicly reported incidents, including this one, and lists the scenarios to revisit. No sign-up is needed.

Other case studies: Microsoft Storm-0558 (2023), Okta support system breach (2023), Salesloft Drift breach (2025), Shai-Hulud 2.0 npm worm (2025), Snowflake and UNC5537 (2024).

Sources

Company statements and official publications are listed first. Press reports are labelled as such.

From the publisher

HumanAudit, which publishes this site, is preparing the NHI Governance pack: an NHI policy, ownership register, lifecycle procedures and one control set mapped, as our interpretation, to PCI DSS v4.0.1, ISO/IEC 27001:2022, NIS2 and DORA. Planned for March 2027; not yet on sale, and no price has been published.

Monthly change log

Know when the NHI landscape changes.

One email a month from this reference: new deals, standards status changes and corrections. No sponsored content. Unsubscribe from any email.

We first email you a link to confirm. Privacy policy.