Skip to main content
Emerging Threats

Attackers Exploit Cloud Keys in Docker Hub Images Within Seconds

Laptop screen displays cloud computing interface on a neutral desk with blurred background.

"The scanners interacting with our images overwhelmingly do so through static analysis, e.g., unpacking image layers or querying the registry API to extract filesystem contents, without ever instantiating the container," explain the researchers.

Stony Brook researchers' controlled experiment

Two researchers from Stony Brook University, Billy Tsouvalas and Nick Nikiforakis, set out to measure how fast credentials embedded in public container images are discovered and abused. Over four months they published 300 honeypot images across eight public container registries and instrumented those images with decoy secrets and detection hooks. The decoys included AWS, OpenAI, and Anthropic API keys alongside fake SSH and database credentials. The team monitored image builds, runs, shell opens, and outbound use of the planted keys.

ContainerBots: automated scanners that never run the container

The authors coined the umbrella term "ContainerBots" for the automated scanners that accessed their images. The scans, they found, displayed no evidence of being coordinated by a single operator; instead, multiple actors or services appeared to be performing rapid, automated extraction. The researchers' telemetry showed that the vast majority of interactions were static: unpacking image layers or querying registry APIs to read filesystem contents, rather than instantiating containers and executing code. Monitoring rarely detected anyone actually running the honeypot images, supporting the conclusion that credentials are typically harvested without running a single container instance.

Speed and scale: downloads, API calls, and exhausted balances

The experiment recorded striking numbers. The honeypot images were pulled more than 75,000 times, and the planted AWS keys received over 140,000 API calls from roughly 5,000 unique IP addresses. The quickest observed abuse of an AWS key occurred 7.86 seconds after an image was published on Docker Hub; the median time to the first API call was 51.19 seconds. All 100 of the planted AWS keys were used within 15 minutes of publication. The OpenAI and Anthropic keys embedded in images were similarly hijacked and used to exhaust test-account balances. Traffic patterns ranged from simple validation checks to listing available resources and, in some cases, consuming those resources.

Docker Hub and registry distinctions

Not all registries saw equal activity. Docker Hub accounted for nearly all of the AWS-related traffic observed by the researchers; another registry in the experiment, Harbor, saw some AWS key abuse as well. After compiling their findings, the researchers reported them to Docker in May and provided the full paper; they received an acknowledgement but no follow-up. A small-scale experiment run in August to test whether defenses had been implemented showed no observable changes to the platform's behavior.

Recommendations the researchers offered

Based on their measurements, the authors recommend that Docker Hub scan images for embedded secrets before allowing them to go live and warn publishers when secrets appear in an image. They also suggested restricting or rate-limiting access to Docker Hub’s public feed of recently published or updated images to blunt mass-scanning tools. Those mitigations target the observed attack vector: automated, static extraction of credentials from image layers and registry APIs.

What this means for registries, cloud services, and developers

  • Registry operators: The data implies a need to detect and deter mass collection from public feeds. Scanning images for embedded secrets and imposing rate limits or access controls on recently published images would directly address the rapid, automated harvesting the researchers observed.
  • Cloud and API providers: The rapid exhaustion and misuse of embedded keys — seen across AWS, OpenAI, and Anthropic test credentials in this experiment — underline the operational burden of revoking and rotating compromised credentials once they leak into public images.
  • Developers and publishers of images: Secrets placed inside image layers can be extracted in seconds without ever running a container. The experiment shows that merely pushing an image to a public registry can expose credentials to thousands of automated scanners within minutes.

The Stony Brook experiment delivers an unambiguous empirical finding: when secrets are embedded in public container images, automated actors can and will extract them almost immediately, largely through static inspection. The researchers' call for registry-side scanning and rate-limiting targets the exact mechanisms their telemetry exposed. Whether registries adopt those measures — and whether such changes would materially reduce the rapid abuse the experiment recorded — are concrete questions that remain unresolved in the wake of these results.

Source: BleepingComputer — Cloud keys leaked in Docker Hub images are stolen within seconds