# Cloud keys left in public Docker Hub images are stolen within seconds

Researchers planted decoy AWS, OpenAI and Anthropic keys in 300 public container images. The fastest theft came 7.86 seconds after publication, and every AWS key was used within 15 minutes.

Source: https://junglewise.ai/news/cloud-keys-left-in-public-docker-hub-images-are-stolen-within-seconds  
Byline: Junglewise News Desk, https://junglewise.ai/news  
Topic: Threat campaigns  
Published: 26 November 2026  
Reading time: 5 min

![Aerial view of a large data centre complex with multiple warehouse-style buildings and cooling units on rooftops](https://hmbbfviplsoqmhdindih.supabase.co/storage/v1/object/public/news-pictures/articles/57f4718e-5c02-4531-8810-4e024a27df5b/0a60bbca-bf85-403a-aae6-9c0e9a4ab71e-1280.jpg)

Picture: [Tedder](https://commons.wikimedia.org/wiki/User:Tedder), [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0) [via Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Amazon_AWS_us-west-2_morrow_east_AZ_01.jpg)

![A tall stack of colourful shipping containers against a blue sky](https://images.unsplash.com/photo-1710762382866-2d12000736ea?ixid=M3w0NDU4NjF8MHwxfHNlYXJjaHwzfHxzaGlwcGluZyUyMGNvbnRhaW5lcnMlMjBzdGFja2VkJTIweWFyZHxlbnwxfDB8fHwxNzk1NzA0NTA1fDA&ixlib=rb-4.1.0&w=1600&q=80&fm=jpg&fit=crop)

Picture: Photo by [Timo Strüker](https://unsplash.com/@omendarkly?utm_source=junglewise&utm_medium=referral) on [Unsplash](https://unsplash.com/?utm_source=junglewise&utm_medium=referral)

A credential accidentally baked into a public container image is not a slow-burning risk. It is used almost immediately. Researchers at Stony Brook University published 300 decoy container images across eight public registries and found that automated scanners extracted and used the embedded cloud keys [within as little as eight seconds](https://bleepingcomputer.com/news/security/cloud-keys-leaked-in-docker-hub-images-are-stolen-within-seconds) of an image going live on [Docker](/threats/technologies/docker) Hub.

For organisations that ship container images publicly, that collapses the window between a mistake and its consequences to roughly nothing. Secrets left in an image layer grant access to corporate cloud accounts and the resources behind them, and the researchers' own figures suggest exposure is common: an earlier study of more than 300,000 Docker images, cited in their paper, [found a secret of some kind in 8.5% of them](https://helpnetsecurity.com/2026/11/25/docker-aws-key-exposure-bots). Docker Hub hosts over 14 million images.

Billy Tsouvalas and Nick Nikiforakis presented the work at the ACM Conference on Computer and Communications Security. They named the automated scanners "ContainerBots", while noting the term is a loose umbrella: the scans showed no evidence that the same operators were coordinating them. In other words, the activity appears to come from many independent scanners rather than a single operation.

## What to do now

- Treat any credential that has ever been in a published public image as compromised, not as potentially compromised. Rotate it, and assume the old one was validated by someone else the moment it went live.
- Scan images for secrets before you push, not after. Revoking leaked keys takes significant work and coordination, and the scanners are faster than any human response.
- Do not rely on registry pull counts as an alarm. Docker Hub's public pull counter lags actual downloads by about five to six minutes, so by the time a spike appears, the key has already been used.
- Restrict the permissions on any API key that touches an image build. In the researchers' second round, some OpenAI and Anthropic keys were issued with restricted permissions, and none of those were used to consume tokens, which suggests the scanners check what a key can do before spending effort on it.
- Keep secrets out of image layers entirely where possible, using runtime injection or a secrets manager, since deleting a file in a later layer does not remove it from the earlier one.
- Avoid image names that advertise sensitive infrastructure. Images with names such as `policyengine/classified-rule-store` drew more than double the pulls per image on Docker Hub compared with blandly named ones.

## Technical details

The researchers published 300 honeypot images over four months across eight public container registries, including Docker Hub, Amazon Elastic Container Registry and Red Hat Quay. Each was a copy of the official nginx image, carrying decoy [AWS](/threats/vendors/aws), OpenAI and Anthropic API keys plus decoy SSH and database credentials.

The images were pulled more than 75,000 times in total. The planted AWS keys attracted over 140,000 API calls from more than 5,000 unique IP addresses.

Timing was the headline result. A planted AWS key was exploited just 7.86 seconds after its Docker Hub image went live. The median duration before the first AWS API call occurred reached 51.19 seconds, with all 100 AWS keys in the first round compromised within 15 minutes. More than half were used within a minute, and 93% within five minutes. The researchers wrote that publication and compromise are, for practical purposes, the same event.

Docker Hub accounted for nearly all of the AWS key abuse. Harbor, another registry in the experiment, saw some activity as well.

Almost every bot opened with an AWS identity check, the "who am I" call that reveals which account a key belongs to, and about half of the observed IP addresses stopped there. That pattern fits mass validation rather than targeted intrusion: confirm the key works, record it, move on.

The AI provider keys behaved differently. OpenAI and Anthropic keys followed a validate, wait, exploit pattern, with small bursts of use after an image push and then weeks of quiet before full exploitation. One OpenAI key received 143 requests in under 24 hours about a month after the final image push, burning through more than 18 million input tokens and emptying the account. Anthropic keys were drained in a single day after an image update on day eight. The researchers speculated that the dormant period reflects validated keys being resold and held idle until a buyer gets around to using them. The whole experiment cost about $60 in OpenAI and Anthropic credits, every cent of it spent by attackers.

Notably, almost nobody actually ran the images. Hidden callbacks designed to alert the researchers if an image was built, run or had a shell opened did not fire at all in the first round of 100 images, and fired only three times across the second round of 200. The conclusion is that scanners extract credentials by static inspection: pulling and unpacking image layers, or querying the registry API, without ever starting a container. Help Net Security reported the likely mechanism as querying a Docker Hub catalogue endpoint that lists recently published or updated images, fetching manifests to work out which layers hold credentials, downloading and unpacking only those layers, and grepping for secret-like strings, all inside a few seconds.

The researchers recommend that Docker Hub scan images for secrets before making them live and warn publishers when secrets are found, and that access to the public feed of recently published or updated images be restricted or rate-limited to blunt mass scanning. SC Media reported similar advice from experts: automated secret scanning and rate-limiting at the registry level.

As for the registry's response, the researchers reported their findings and the full paper to [Docker](/threats/vendors/docker) in May and received an acknowledgment but no further replies. At the time the paper was written, Docker's security team was reviewing the findings. A small follow-up experiment in August, run to check whether any defences had appeared, found no changes on the platform.

## On Junglewise Threat Intelligence

- [Docker](https://junglewise.ai/threats/technologies/docker)
- [AWS](https://junglewise.ai/threats/vendors/aws)
- [Docker](https://junglewise.ai/threats/vendors/docker)

## Related articles

- [Microsoft: Chinese and North Korean groups among those using ARTEX AI tool](https://junglewise.ai/news/microsoft-chinese-and-north-korean-groups-among-those-using-artex-ai-tool)
- [European Commission confirms cyberattack that misused a publicly available AI tool](https://junglewise.ai/news/european-commission-confirms-cyberattack-that-misused-a-publicly-available-ai)
- [Attackers are running AI agent frameworks that turn patches into exploits](https://junglewise.ai/news/attackers-are-running-ai-agent-frameworks-that-turn-patches-into-exploits)
- [Fake job assessments hide malicious NuGet packages that run when .NET developers build](https://junglewise.ai/news/fake-job-assessments-hide-malicious-nuget-packages-that-run-when-net-developers)
