New research has shown how mechanical bots can snatch exposed AWS credentials from public container images on Docker Hub in under 10 seconds. A Stony Brook University study revealed that a dummy AWS key embedded in a Docker image was accessed by an external party just 7.86 seconds after the image was published. That was the fastest instance—they also found that the median time for a key to receive its first request was about 51 seconds, and all 100 such keys were exploited within 15 minutes. These findings expose a major risk in how fragile secret data can be.
The researchers, led by Billy Tsouvalas and Nick Nikiforakis, uploaded 300 test images across eight different public container registries over four months. These images contained fake AWS, OpenAI, and Anthropic credentials, as well as dummy SSH and database keys. They didn’t announce the images; none were meant to go viral. There was no breach of Docker itself—rather what the study tracked was how quickly the planted keys were found and abused once made public.
In the initial batch alone, 100 unannounced Docker Hub images racked up over 58,000 downloads. The planted AWS credentials generated more than 66,000 API requests from nearly 4,000 unique IP addresses. Importantly, even though the SSH or DB credentials were never likely executed, the AWS keys were actively used—showing that attackers often mine credentials purely from image files without ever running the container.
How Do Bots Harvest These Secrets?
Attackers can scrape container registries for credentials embedded in image layers and metadata. Even if a password or secret gets deleted in a later stage of building the image, the earlier layers—where secrets often lurk—can still be accessed. That means standard code reviews or watching live container behavior often won’t catch the risk.
Mitigations and Best Practices
AWS logs revealed a variety of misuses—some bots checked whether a key was valid, others attempted to list cloud resources or use paid services. The planted OpenAI and Anthropic credentials, lacking the same usage restrictions, resulted in unexpected billing. That contrast underlines why minimal permissions and limited access should be non-negotiable.
To prevent leaks, developers should scan complete container images—including image layers and metadata—before pushing them to any registry. They should avoid embedding secrets via Dockerfile ARG or ENV, and instead use build-time secret mounts. On AWS environments, temporary credentials tied to specific roles are safer than long-lived keys.
If an AWS key has already been published, it should be revoked and replaced immediately. Deleting an image won’t stop damage if anyone has already copied the credential. Developers should review AWS CloudTrail logs for strange access or resource creation after publishing and consider implementing automated restrictions or “key quarantine” to block risky actions.
After sharing the research, Docker’s security team confirmed it had received the findings and proposed two changes: introduce secret-scanning before images are published, and limit the visibility of newly uploaded public images. Of these, scanning beforehand is seen as the most practicable step—one that stops leakage before it starts.
This study isn’t just theoretical. Earlier investigations uncovered hundreds of corporate AWS credentials with full administrative rights exposed in the wild. The speed at which bots found test keys in this controlled environment—even when access was carefully secluded—shows that the threat landscape for cloud secrets is accelerating. It’s a wake-up call that many organizations may be unprepared for.
While secrets being exposed in code or configuration has long been a concern, embedding them in container images introduces new stealth risks. This isn’t just about carelessness—it highlights systemic gaps in how container workflows are secured. Going forward, what really matters is culture shift: treating every published artifact as a potential vector of compromise, and baking in security from build-time all the way through deployment.