Access keys left inside public container images can be found and used by bots within seconds. In an experiment by Stony Brook University, the fastest planted AWS key was used 7.86 seconds after the image was published on Docker Hub — and all 100 AWS keys were used within 15 minutes.
The study, presented at the ACM Conference on Computer and Communications Security (CCS), used 300 honeypot images published across eight public container registries over four months. Researchers Billy Tsouvalas and Nick Nikiforakis planted decoy AWS, OpenAI and Anthropic keys, along with fake SSH and database credentials, and monitored when — and how — they would be used.
The numbers from the experiment
- 7.86 seconds: the fastest use of an AWS key after publication on Docker Hub.
- 51.19 seconds: the median time to the first API call.
- 15 minutes: the time for all 100 AWS keys to be used.
- More than 75,000: pulls of the honeypot images; the AWS keys received more than 140,000 API calls from 5,000 different IP addresses.
- Docker Hub: accounted for nearly all AWS key activity; the Harbor registry also saw some abuse.
The exposed OpenAI and Anthropic keys were quickly hijacked to exhaust the test accounts' balances. Traffic ranged from checks to see whether the keys worked to listing available resources — and, in some cases, consuming them.
How the bots operate
The researchers dubbed the automated systems ContainerBots, but stress that the term is only a label: there is no evidence that the different scans are coordinated by a single operator. Monitoring rarely detected anyone actually running the honeypot images — the bots extract secrets by inspecting image layers or querying the registry API, without ever running the container.
“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,” the researchers explain.
What the researchers ask for
The authors recommend that Docker Hub scan images for secrets before publishing them and warn publishers when secrets appear to be embedded. They also suggest restricting or rate-limiting access to the public feed of recently published or updated images, to hamper mass-scanning tools.
According to Tsouvalas, the researchers reported their findings to Docker in May, with the full paper, but beyond an acknowledgement there was no follow-up. A small-scale test in August to check whether any defences had been implemented showed no changes. No public statement from Docker about the study was found.
What to do if a key leaks
The study reinforces a basic security rule: secrets should never be embedded in an image's layers. If a key shows up in a public image, immediate revocation is the only response — within seconds, it may already be in use. Docker's documentation recommends using build secrets, which are not recorded in the final image.
Featured image: BleepingComputer's illustration for the report on the study — the Docker logo surrounded by keys and stopwatches.
Transparency note: this article was produced with the help of artificial intelligence, based on cross-checking public posts and the internet sources listed below. Please consult the original sources to confirm the facts.
By Muse