Docker Hub Leaked Keys: Abused 7.86 Seconds After Upload
If someone builds or hosts your website or web app, ask them one question this week: do we publish any public container images, and are our passwords and keys kept out of them? New research shows that keys left inside pu
If someone builds or hosts your website or web app, ask them one question this week: do we publish any public container images, and are our passwords and keys kept out of them? New research shows that keys left inside public Docker Hub images can be found and used in seconds, not days.
What happened
Two researchers at Stony Brook University, Billy Tsouvalas and Nick Nikiforakis, wanted to measure how fast attackers find secrets hidden inside public container images. A container image is a packaged copy of an app, with its code and settings, that developers upload to a "registry" such as Docker Hub so servers can download and run it.
Over four months, in two rounds, they published 300 test images across eight public registries. Inside, they planted decoy secrets: AWS cloud keys, OpenAI and Anthropic (Claude) API keys, and fake SSH and database logins. They also added small "beacons" that would alert them if anyone built or ran the images. Their paper, "Gone in 8 Seconds: Uncovering Malicious Bots Operating on Public Container Registries," appears in the proceedings of ACM CCS 2026, and BleepingComputer reported on it on 17 November 2026.
The results:
- On Docker Hub, the fastest use of a planted AWS key came 7.86 seconds after the image was published. The median time to first use was 51.19 seconds.
- BleepingComputer reports that all 100 AWS keys were used within 15 minutes.
- Across the study, the AWS keys received more than 140,000 API calls from more than 5,000 unique IP addresses, and the images were pulled more than 75,000 times.
- The OpenAI and Claude keys were drained of their full account balances in short bursts.
- Docker Hub drew almost all of the AWS activity. One other registry, Harbor, saw some.
The most important detail for business owners: the bots almost never ran the images. The researchers say the scanners "overwhelmingly" pulled secrets out through static analysis, by unpacking image layers or querying the registry, "without ever instantiating the container." In plain terms, nobody has to break into your server. If a key is inside a public image file, reading the file is enough.
The researchers say they reported their findings to Docker in May. Tsouvalas told BleepingComputer they received an acknowledgment but no follow-up, and a small test in August showed no change. We did not find a public statement from Docker about the study.
Who is affected
You are at risk if all three are true:
- Your site or app is shipped as a container image (common for custom web apps, headless stores, APIs and AI features).
- That image was ever pushed to a public repository, even for a few minutes.
- A secret was inside it: the site's
.envfile, a database password, a Stripe or other payment key, a cloud access key, or an AI provider key.
Many small businesses never see this layer. An agency or freelancer builds the app, pushes an image, and the hosting runs it. That is exactly why it is worth asking.
What a leaked key can cost you
The study saw AWS keys tested, used to list the resources they could reach, and sometimes used to consume those resources. AI keys were spent down to zero. For a small business, the same pattern can mean a cloud or AI bill you did not run up, customer data read from a database, or an attacker changing your site. We saw the same "find the key, test it, spend it" pattern in our post on how AI agents now hunt exposed API keys.
The dark-web side
This study did not track whether stolen keys were resold. In general, though, working credentials are a commodity: some attackers use them right away, others pass them on to people who will. That is why "the image was only public for a minute" is not a defense, and why a dark-web check is a lagging signal at best. Our guide on what a dark web scan checks for your website, and what it does not explains the limits.
What to check
Ask your developer or host to confirm, in writing if possible:
- Which images are public. List every repository on Docker Hub or any other registry and whether it is public or private.
- No secrets inside images. Docker's own documentation says build arguments and environment variables are "inappropriate for passing secrets" to a build "because they persist in the final image." Keys should be supplied at runtime or through a secrets manager.
- Deleted is not gone. A file removed in a later build step can still sit in an earlier image layer, and deleting an image does not un-leak a key that was already copied.
- Rotate anything exposed. If a key was ever in a public image, replace it with a new one and turn the old one off. Then check the account's logs and bills for activity you do not recognize. Our API token rotation checklist walks through the order.
- Limit damage. Use separate keys per project, with the smallest permissions that work and spending limits on AI and cloud accounts.
A free website security scanner can show what your public website exposes from the outside, such as leftover public files or missing security headers. It cannot see inside your container images or your registry account. Those checks need your developer or host.
FAQ
Does this mean Docker Hub was hacked?
No. Nobody broke into Docker Hub. The researchers measured what happens when secrets are placed inside images that anyone can download. The bots simply read what was published.
My site is on WordPress with ordinary hosting. Does this apply to me?
Probably less, but ask. If your site uses a custom app, an API, an AI feature or a headless store built by an agency, it may be shipped as a container. The question to ask is the same either way: where are our keys stored, and could any of them be public?
If we deleted the public image, are we safe?
Not on its own. In this study, the first key was used within seconds, so assume a key that was public has already been copied. Replace it, then review the account's activity.
The simple action for today: send your developer or host one message asking whether any of your images are public and whether secrets are kept out of them, and replace any key that was ever exposed.
Sources: Tsouvalas and Nikiforakis, "Gone in 8 Seconds: Uncovering Malicious Bots Operating on Public Container Registries," ACM CCS 2026, https://doi.org/10.1145/3830454.3846791 (abstract via https://containerbots.github.io/); BleepingComputer, 17 November 2026, https://www.bleepingcomputer.com/news/security/cloud-keys-leaked-in-docker-hub-images-are-stolen-within-seconds/; Docker documentation, Build secrets, https://docs.docker.com/build/building/secrets/.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.