Cloud Keys Leaked in Docker Hub Images Are Stolen Within Seconds

November 18, 2026

Security researchers have demonstrated that cloud credentials accidentally leaked in public Docker Hub images are being stolen within seconds of publication, highlighting an ongoing and largely unaddressed risk in containerized software supply chains.

The findings show that automated bots continuously scan newly published Docker Hub images for exposed secrets, including AWS access keys, GitHub tokens, and database credentials. When a container image containing plaintext secrets is pushed to a public repository, these bots extract the credentials almost immediately, often before the publisher even realizes the mistake.

The attack is straightforward in execution but devastating in impact. Attackers pull the image, inspect its filesystem layers for configuration files, environment variables, and hardcoded credentials, then use the stolen keys to access cloud infrastructure, spin up cryptocurrency mining operations, or pivot into deeper network access.

Researchers documented cases where AWS keys leaked in Docker images were used to provision compute resources within minutes of the image being published. In one instance, a researcher deliberately published a container with a honeypot AWS key and observed unauthorized API calls within 30 seconds of the image becoming publicly available.

The root cause is cultural as much as technical. Developers frequently embed secrets directly in container layers during testing or local development, then push the images to public registries without scrubbing them. Docker Hub, as the largest public container registry with over 10 million images, presents an enormous attack surface for automated credential harvesting.

Mitigation requires a combination of practices: using multi-stage builds to exclude secrets from final images, leveraging Docker BuildKit secret mounting to pass credentials without persisting them in layers, and implementing automated scanning of container images before publication. Cloud providers have also introduced secret detection in their registries, but public registries like Docker Hub remain largely unmonitored.

Source: BleepingComputer [1]


[1] BleepingComputer - Cloud keys leaked in Docker Hub images are stolen within seconds