Cloud keys leaked into Docker Hub images are stolen within seconds
Researchers from Stony Brook University found that attackers extract secrets from public Docker images almost immediately: the first AWS request was recorded after 7.86 seconds.

Billy Tsouvalas and Nick Nikiforakis published test images containing AWS, OpenAI, and Anthropic keys, as well as decoys such as SSH and database credentials. They monitored the publications in public container registries, tracking image builds, launches, and shell access.
The test images were downloaded over 75,000 times. In AWS, the researchers recorded more than 140,000 API requests: some checked the keys' functionality, others requested available resources, and occasionally, they were used to spend funds. The median time to the first request was 51.19 seconds, and all AWS keys were used within 15 minutes. OpenAI and Anthropic keys were quickly exploited to deplete the balances of test accounts.
Almost all activity occurred on Docker Hub. According to the authors, scanners typically did not launch containers but extracted secrets through static analysis of image layers or via the registry API. The researchers recommended checking images before publication and restricting access to the feed of new materials. In May, they shared the results with Docker, but after confirming receipt, no response followed; a review in August revealed no changes.





