Coder’s Registry Was Hijacked. The Malicious Terraform Modules Stole the Keys
- The Mess: Attackers compromised Coder’s registry infrastructure and redirected part of
registry.coder.comtraffic to their own server, serving tampered Terraform modules designed to steal credentials. - The Damage: Anyone provisioning a Coder workspace during the attack window may have handed cloud, CI/CD, SSH or AI credentials directly to the attacker.
- The Fix: Audit Coder deployments that pulled registry modules between August 31 and September 1, rotate exposed credentials, and follow Coder’s incident-response guidance immediately.
This wasn’t a vulnerability in Terraform.
It was worse.
Someone compromised the distribution point.
On August 31, attackers obtained access to a Cloudflare API key associated with Coder and used it to manipulate traffic for registry.coder.com. Between 07:35 and 21:45 UTC, some registry requests were redirected to attacker-controlled infrastructure.
The malicious server returned modified versions of legitimate Terraform modules.
The modules still looked useful.
They still performed their expected provisioning tasks.
They just did something extra.
They stole secrets.
Terraform Did the Work for Them
The malicious modules abused Terraform’s external data source functionality.
That feature can execute an external program and return its output to Terraform.
Normally, that’s legitimate automation.
In this case, it became a credential collection mechanism.
The injected code could access secrets available to the provisioning process and send them to attacker-controlled infrastructure.
That potentially included:
- AWS credentials
- Google Cloud credentials
- Azure credentials
- CI/CD secrets
- SSH keys
- OIDC tokens
- environment variables
- configuration secrets
- AI provider API keys
The important part is that the attacker didn’t need to exploit each victim individually.
They compromised the place where trusted building blocks were downloaded.
Then the customers executed the malicious code themselves.
The AI Connection Is the Ugly Part
Coder isn’t only used for traditional developer environments anymore.
Its infrastructure is increasingly used to provision environments for AI coding agents.
That means a compromised Terraform module can potentially reach credentials belonging to both the infrastructure and the AI tooling operating inside it.
Cloud Security Alliance’s analysis published today highlights this exact problem: Coder workspaces can contain cloud credentials, CI/CD secrets and AI-provider tokens, making the registry a particularly valuable supply-chain target.
The attacker doesn’t need to compromise the AI agent.
They compromise the environment in which the agent runs.
That’s a much simpler attack.
The Window Was Short. The Credentials Aren’t.
Coder says the malicious routing was active for roughly 14 hours.
The company removed the unauthorized IP addresses, cleared its cache and confirmed that its own codebase and Google Cloud infrastructure were not compromised.
But a short compromise window doesn’t mean a short-lived compromise.
If a malicious Terraform module copied an AWS key, an SSH key or an API token, that credential doesn’t magically expire when Coder fixes its registry.
The attacker can keep using it.
That’s why Coder recommends checking logs for traffic to the attacker’s lookalike domain and identifying deployments that may have consumed affected modules.
This Is What a Modern Supply-Chain Attack Looks Like
The old model was simple:
Compromise software → distribute malware.
The newer model is much quieter:
Compromise trusted infrastructure → modify legitimate artifact → let customers execute it.
No suspicious installer.
No fake download button.
No phishing email.
The victim runs the normal provisioning process.
The pipeline does the rest.
That’s why registry infrastructure has become such a valuable target.
A single compromised distribution point can turn thousands of legitimate deployments into execution opportunities.
Bugstoday Opinion
The most interesting part of the Coder incident isn’t that someone stole a Cloudflare API key.
Keys get stolen.
The interesting part is what came next.
The attacker didn’t need to break every customer’s cloud environment.
They changed where trusted infrastructure came from.
Then Terraform became the delivery mechanism.
That is supply-chain compromise stripped down to its most efficient form.
And the AI angle makes it nastier.
Developer environments increasingly contain cloud credentials, deployment secrets and AI API keys at the same time.
Compromise the environment once and you may get all three.
The lesson is brutally simple:
Your provisioning pipeline is part of your attack surface.
If you trusted the registry, that doesn’t mean the artifact you received was trustworthy.
Today’s Bugs. Tomorrow’s Breaches.
Technical Sources
- Coder — Registry Security Incident
- Cloud Security Alliance — Coder Registry Compromise analysis
- Coder Security Advisory — GHSA-vx42-ghc9-gw65




