Attackers are harvesting credentials and API keys from publicly available container images on Docker Hub and other registries with remarkable speed. A study by Stony Brook University researchers Billy Tsouvalas and Nick Nikiforakis demonstrated that exposed secrets can be discovered and exploited in as little as eight seconds after an image goes live.

The researchers conducted their investigation by uploading 300 honeypot images to eight different public container registries over a four-month period. The test images contained AWS, OpenAI, and Anthropic API keys, along with decoy SSH and database credentials. The team used detection mechanisms to track when the images were downloaded, executed, or accessed via shell.

image

Results from the experiment, presented at the ACM Conference on Computer and Communications Security (CCS), revealed the scale of the threat. The honeypot images were pulled more than 75,000 times total. The planted AWS keys alone generated over 140,000 API calls originating from 5,000 distinct IP addresses.

The exploitation timeline was striking. The fastest instance of a planted AWS key being used occurred just 7.86 seconds after publication on Docker Hub. The median time before the first API call was 51.19 seconds. Within 15 minutes, all 100 AWS keys had been accessed. The exposed OpenAI and Anthropic credentials were similarly compromised quickly, with attackers using them to drain test account balances.

Docker Hub was the primary source of AWS key abuse, though Harbor, another registry included in the study, also experienced unauthorized key usage. The attackers' behavior ranged from validating whether credentials were functional to enumerating available resources and, in some cases, consuming them.

How the scanning works

API call times after image publication
API call times after image publication Source: containerbots.github.io

The researchers identified the threat actors as "ContainerBots," though they emphasized this is a broad classification rather than evidence of coordinated activity. The scans showed no signs of being orchestrated by a single operator or group.

Notably, monitoring detected very few instances of anyone actually instantiating and running the honeypot containers. This observation led the researchers to conclude that the scanners were extracting credentials through static analysis of image layers rather than by executing the containers themselves.

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

Billy Tsouvalas and Nick Nikiforakis

The practice of embedding secrets in container images is widespread in production environments, and revoking compromised credentials typically demands substantial effort and coordination across teams.

Recommendations and Docker's response

The researchers proposed several defensive measures. They called on Docker Hub to implement pre-publication scanning of images to detect embedded secrets and alert publishers when potential credentials are found. They also recommended that Docker Hub restrict or implement rate-limiting on access to its public feed of recently published or updated images, which would make mass-scanning operations more difficult.

Tsouvalas reported the findings to Docker in May, submitting the complete research paper alongside the disclosure. Beyond an initial acknowledgment, Docker provided no substantive response. A follow-up test conducted in August found no evidence that any defensive measures had been deployed on the platform.