Supply Chain Attacks

CircleCI Security Incident January 2023: What Happened and What We Learned

CircleCI's January 2023 breach exposed secrets for thousands of organizations. Here's how the attack unfolded and what it means for CI/CD security.

Yukti Singhal
Security Researcher
6 min read

On January 4, 2023, CircleCI — one of the most widely used continuous integration and delivery platforms — issued an urgent security advisory telling all customers to rotate every secret stored in the platform. This wasn't a precautionary measure. It was a full-blown breach that affected thousands of organizations and exposed an uncomfortable truth about the fragility of modern software supply chains.

What Actually Happened

CircleCI disclosed that an unauthorized actor had gained access to their systems, compromising customer environment variables, tokens, and keys stored within the platform. The attacker had obtained access through a compromised employee laptop that had malware capable of stealing session tokens, even bypassing two-factor authentication.

The timeline is worth paying attention to:

  • December 16, 2022: The attacker compromised an engineer's laptop using malware that exfiltrated active session tokens.
  • December 19, 2022: The attacker used those stolen session tokens to impersonate the employee and access internal CircleCI production systems.
  • December 22, 2022: The attacker began exfiltrating customer data, specifically targeting environment variables, tokens, and keys stored in CircleCI projects.
  • January 4, 2023: CircleCI publicly disclosed the incident and urged all customers to immediately rotate secrets.

That's roughly two weeks of dwell time before detection. During this window, the attacker had access to encryption keys used to encrypt stored secrets.

The Scale of the Problem

CircleCI processes over a million jobs per day for organizations ranging from startups to Fortune 500 companies. The secrets stored in CircleCI include:

  • API keys for cloud providers (AWS, GCP, Azure)
  • Database credentials
  • Package registry tokens (npm, PyPI, Docker Hub)
  • SSH keys for server access
  • Third-party service tokens (Slack, GitHub, etc.)

When CircleCI told everyone to rotate everything, it wasn't hyperbole. Any secret that had ever been stored as an environment variable or context in CircleCI was potentially compromised. For many organizations, that meant rotating hundreds of credentials across dozens of services.

Why This Attack Matters for Supply Chains

This incident highlights a critical weakness in software supply chains: the CI/CD system is a single point of trust that touches everything. Your CI/CD platform knows your source code, your deployment credentials, your infrastructure secrets, and your build processes. Compromise the CI/CD system, and you've compromised the entire software delivery pipeline.

The attack didn't require finding a zero-day in CircleCI's code. It didn't exploit a misconfigured API. It started with a compromised laptop — the kind of thing that happens every day — and escalated from there because session tokens granted broad access without additional verification checkpoints.

The Session Token Problem

The attacker didn't need to crack passwords or bypass MFA in real-time. They stole a valid session token from a compromised machine. Once they had that token, the authentication system treated them as a legitimate, already-authenticated user.

This is a fundamental design challenge. Session tokens exist because you can't ask a user to re-authenticate for every request. But they also represent a significant attack surface, especially when they grant access to production systems containing customer secrets.

What Organizations Should Have Learned

1. Don't Trust Your CI/CD Platform as a Secret Store

CircleCI, GitHub Actions, Jenkins, GitLab CI — none of these should be your primary secret store. They should pull secrets at runtime from dedicated vaults like HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault. The CI/CD platform should have short-lived, scoped credentials that are rotated frequently.

2. Audit What Secrets Your CI/CD Has Access To

Most organizations have no idea how many secrets are stored in their CI/CD pipelines. Over the years, engineers add environment variables for various integrations, and nobody audits what's there or whether it's still needed. After the CircleCI incident, many organizations discovered they had ancient credentials for services they no longer used sitting in their pipelines.

3. Monitor for Unusual CI/CD Activity

The attacker had access for over two weeks before detection. CI/CD systems generate logs — unusual access patterns, mass export of environment variables, or access from unusual IP addresses should trigger alerts.

4. Implement Zero-Trust Principles in Build Systems

Every build job should have the minimum secrets necessary. Use OIDC federation instead of long-lived credentials where possible. AWS, GCP, and Azure all support OIDC tokens from CI/CD providers, meaning you can grant temporary, scoped access without storing persistent credentials.

5. Have a Secret Rotation Plan

When CircleCI said "rotate everything," many organizations realized they had no process for doing that. Some secrets were embedded in configurations, hardcoded in scripts, or shared across multiple services without documentation. If you can't rotate all your secrets in 24 hours, you have a preparedness gap.

The Broader Industry Response

The CircleCI incident accelerated several industry trends:

  • OIDC adoption for CI/CD: Major cloud providers saw increased adoption of OIDC-based authentication from CI/CD platforms, reducing reliance on stored credentials.
  • Secret scanning improvements: GitHub, GitLab, and others expanded their secret scanning capabilities.
  • Shorter session lifetimes: Many organizations reduced session token lifetimes and implemented more aggressive session validation.
  • Zero-trust CI/CD: The concept of applying zero-trust principles to build environments gained significant traction.

The Uncomfortable Truth

The CircleCI breach wasn't sophisticated. It was a malware-infected laptop leading to session theft leading to data exfiltration. The reason it was so impactful is because of how much trust we place in CI/CD platforms and how poorly most organizations manage secrets within them.

Every CI/CD pipeline is a potential supply chain attack vector. The question isn't whether your CI/CD platform will be targeted — it's whether you've designed your systems to limit the blast radius when it happens.

How Safeguard.sh Helps

Safeguard.sh addresses the core issues exposed by the CircleCI incident:

  • Pipeline Security Monitoring: Safeguard.sh monitors your build pipelines for anomalous behavior, including unusual secret access patterns, unexpected builds, and changes to pipeline configurations.
  • SBOM-Driven Dependency Tracking: By generating and analyzing SBOMs for every build, Safeguard.sh ensures you have full visibility into what's being built and deployed, making it easier to detect unauthorized changes.
  • Secret Exposure Detection: Safeguard.sh scans your repositories and build artifacts for exposed secrets, helping you identify credentials that should be rotated or moved to dedicated vaults.
  • Supply Chain Integrity Verification: Safeguard.sh verifies the integrity of your software artifacts from build to deployment, ensuring that compromised CI/CD credentials can't be used to inject malicious code undetected.

The CircleCI incident proved that CI/CD security isn't optional — it's foundational. Platforms like Safeguard.sh exist because the software supply chain has become the primary attack surface, and organizations need continuous visibility into every link in that chain.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.