Hackers Steal Exposed AWS Credentials From Docker Hub Images in Just 8 Seconds

Blog WriterCybersecurity News - Original News Source is cybersecuritynews.com


Automated bots used a decoy Amazon Web Services (AWS) access key just 7.86 seconds after researchers published the Docker Hub image containing it. That was the fastest case in a controlled Stony Brook University study, not the average.

Still, the median time to the first AWS request was just 51.19 seconds, and all 100 keys in the first round were used within 15 minutes. The study did not report a break-in at Docker Hub. It showed how quickly a secret left inside a public image can be found and used.

Researchers Billy Tsouvalas and Nick Nikiforakis published 300 test images across eight public container registries over four months. They planted AWS, OpenAI, and Anthropic API keys, along with decoy SSH and database credentials.

In the first round alone, 100 unadvertised Docker Hub images were downloaded 58,819 times. The AWS keys inside them drew 66,321 requests from 3,842 distinct IP addresses. Those addresses indicate where requests came from, not how many attackers were involved.

A container image packages an application and its files in layers. The researchers saw no signs that anyone ran the images in the first round, despite heavy use of the planted keys.

That points to bots reading the image layers directly. It also explains why watching running containers would miss this kind of leak. A file removed in a later build step can still be present in an earlier layer.

Exposed AWS Credentials From Docker Hub Images

AWS logs showed that some requests checked whether a key worked, while others tried to list cloud resources or use paid services. The study’s first-round restrictions blocked attempts to consume AWS resources.

Image instrumentation: Injection of dynamic lifecycle beacons, static honeytokens, and honeypot credentials(source : dl.acm )
Image instrumentation: Injection of dynamic lifecycle beacons, static honeytokens, and honeypot credentials(source: dl.acm )

However, requests made with planted OpenAI and Anthropic keys drained the researchers’ test balances. The difference illustrates why permissions matter. A separate investigation covered by Cyber Security News found 768 exposed corporate AWS credentials with full admin access.

Scan the built image before uploading it, not just the source code. The scan should cover image layers and metadata because a clean project folder does not guarantee a clean image.

If a build needs a password or token, use Docker BuildKit secret mounts to make it available only during the build step that needs it. Avoid putting secrets in Dockerfile ARG or ENV instructions. For applications running on AWS, prefer roles that issue temporary credentials with only the permissions the application needs.

Parallel log streams aggregation diagram for de-ployment of instrumented image (source : dl.acm )
Parallel log streams aggregation diagram for deployment of instrumented image (source: dl.acm )

If an AWS key has already shipped in a public image, deactivate it immediately and replace it if the application still needs one. Removing the image does not invalidate a copied key.

Review AWS CloudTrail logs from the time of publication for unfamiliar requests, permission changes, and unexpected resource creation. As Cyber Security News reported in its coverage of AWS key quarantine, automatic restrictions can block some actions without revoking the key.

The researchers shared their findings with Docker, whose security team acknowledged the report. They proposed checking images for secrets before publication and limiting access to the public feed of new and updated images. For developers, the most useful change is one they can make now. Put the secret check before the upload, when a failed scan can still stop a leak.

Give your SOC the alert context on the latest threats to stop incidents quickly -> Integrate Threat Intel from 16K SOCs

The post Hackers Steal Exposed AWS Credentials From Docker Hub Images in Just 8 Seconds appeared first on Cyber Security News.