All vulnerabilities
HIGHSupply chainexploited in the wild

SC-CODECOV-BASH-UPLOADER-2021

CI/CD · Codecov Bash Uploader

Summary

On January 31, 2021 attackers extracted a credential from an error in Codecov's Docker image creation process and used it to modify the company's Bash Uploader script. From January 31 until discovery on April 1, the altered script silently exfiltrated the CI environment variables of Codecov customers to a remote attacker-controlled server. Exposed data could include AWS IAM keys, deploy keys, API keys, service-account credentials, tokens and passwords. Codecov has over 23,000 customers and the breach went undetected for roughly two months until a customer noticed a hash mismatch.

How to avoid it in your code

  • Verify the integrity (checksum / GPG signature / SRI) of any uploader or installer script before executing it.
  • Avoid piping remote scripts straight into a shell (curl | bash) in CI; vendor and pin a reviewed copy.
  • Scope CI secrets to least privilege and rotate them on any uploader or tooling compromise.
  • Restrict and monitor CI runner egress so a poisoned tool cannot exfiltrate environment variables.
  • Pin third-party tooling to a known-good version and watch for unexpected upstream changes.

References

Related vulnerabilities

All Supply chain →