Cloud Keys Leaked in Public Docker Hub Images Are Hijacked Within Seconds of Publication
Secrets accidentally left inside public Docker Hub images are being found and abused almost instantly. In a controlled experiment, security researchers planted cloud credentials in container images and watched attackers use the first key less than eight seconds after publication. All 100 planted Amazon Web Services keys were used within 15 minutes.
What the Researchers Did
The researchers built container images that contained real but monitored credentials, including 100 AWS access keys along with API keys for AI services from OpenAI and Anthropic. They published the images to Docker Hub, the largest public registry for container images, and placed detection tools inside them that alerted when an image was built, run or opened with an interactive shell.
The images were pulled more than 75,000 times. The planted AWS keys received more than 140,000 API calls from about 5,000 unique IP addresses, showing that many separate actors are scanning the registry for the same kind of mistake.
The fastest observed use of an AWS key came 7.86 seconds after the image was published, and the median time to the first API call was about 51 seconds. The AI service keys were also hijacked quickly after the images went live.
A Long-Running Problem
Leaked secrets in container images are not new. A scan of images uploaded to Docker Hub in November 2025 found more than 10,000 exposing keys, including live production credentials and thousands of AI service keys, most of which were never revoked. An academic study of more than 337,000 images from Docker Hub and other registries found tens of thousands containing secrets such as private keys and API credentials.
The new experiment adds a measure of speed. Earlier research showed how often secrets leak, while this test shows that attackers are watching the registry continuously and acting on what they find within seconds.
The most common cause is ordinary developer workflow. Configuration files containing credentials, such as environment files, get copied into an image during the build and remain in its layers even if a later build step deletes them.
Why It Matters
The speed changes the response model for leaked credentials. Many organizations rely on secret scanning that runs after code or images are published, followed by manual revocation. When abuse begins in under ten seconds, any process that depends on someone noticing and reacting is already too late.
Stolen cloud keys are typically used for cryptocurrency mining, data theft, spam or launching further attacks, and the resulting bills can grow large before the owner notices. AI service keys carry similar risks, letting attackers run expensive workloads at the victim's expense or abuse the services for their own operations.
Because so many separate IP addresses used the planted keys, the scanning is not the work of a single group. It is an automated, widespread practice, which means any public image containing a valid secret should be treated as compromised the moment it goes live.
What To Do
Development teams should keep credentials out of container images entirely, loading them at runtime from a secrets manager or the orchestration platform instead. Builds should use .dockerignore rules to exclude environment and configuration files from the image, and images should be scanned for secrets before they are pushed, not after.
Any credential that has ever appeared in a public image should be revoked and replaced immediately, even if the image was removed. Cloud accounts should use short-lived credentials, least-privilege permissions and spending alerts, and teams should monitor for API activity from unfamiliar locations, which is often the first sign a key has been stolen.
Domain Intelligence
No adverse evidence is confirmed across reputation sources, and no active malicious associations appear in the canonical trust record. One threat-intelligence source flagged adverse evidence that was not independently corroborated and does not affect the score. The score reflects the domain's current evidence profile and is separate from the credential leaks described in the research, which stem from images published by individual users.