In a startling revelation for developers and organizations, new research indicates that credentials and access secrets inadvertently exposed in public Docker Hub images are being extracted and exploited by attackers with alarming speed – in some cases, as little as eight seconds after publication.
The Alarming Speed of Docker Hub Credential Theft
Two researchers from Stony Brook University, Billy Tsouvalas and Nick Nikiforakis, conducted an experiment to measure how quickly exposed secrets are compromised. They published 300 honeypot images across eight public container registries over four months, embedding decoy AWS, OpenAI, and Anthropic API keys, alongside SSH and database credentials. Their findings, presented at the ACM Conference on Computer and Communications Security (CCS), showed that these images were pulled over 75,000 times. The planted AWS keys alone received more than 140,000 API calls from 5,000 unique IP addresses.
The fastest observed use of a planted AWS key occurred a mere 7.86 seconds after the image was published on Docker Hub. The median time for the first API call was 51.19 seconds, with all 100 AWS keys being used within 15 minutes. The exposed OpenAI and Anthropic keys were also quickly hijacked, leading to the exhaustion of test-account balances. Docker Hub accounted for nearly all AWS activity, though some abuse was also noted on Harbor, another registry in the experiment.
The researchers dubbed the automated scanners interacting with their test images “ContainerBots.” Interestingly, monitoring rarely detected anyone actually running the honeypot images. This led to the conclusion that these scanners primarily extract credentials by inspecting image layers directly, rather than instantiating the containers. As the researchers explained, “The scanners interacting with our images overwhelmingly do so through static analysis, e.g., unpacking image layers or querying the registry API to extract filesystem contents, without ever instantiating the container.”
Who is at Risk from Leaked Docker Hub Secrets?
Any developer or organization that publishes Docker images to public registries, especially Docker Hub, is at risk if their images contain embedded credentials or access secrets. The speed at which these secrets are compromised means that even a brief exposure can lead to significant security breaches. The broad pattern of AWS traffic observed, from checking key validity to listing and consuming resources, highlights the potential for serious damage, including unauthorized access to cloud infrastructure, data theft, and financial losses from misused API keys.
The researchers reported their findings to Docker in May, along with a full paper, but noted that a follow-up experiment in August showed no changes in platform defenses. This suggests that the vulnerability remains active, and the onus is currently on publishers to secure their images.
How to Protect Your Cloud Keys and Docker Images
Protecting your sensitive credentials requires vigilance and proactive measures. Here’s a checklist to help safeguard your Docker images and cloud keys:
- Never embed credentials directly in Docker images: Use environment variables, Docker secrets, or external secret management services instead.
- Implement automated scanning: Integrate tools into your CI/CD pipeline to scan Docker images for embedded secrets before they are pushed to public registries.
- Regularly rotate keys: Even if you believe your keys are secure, regular rotation minimizes the window of opportunity for attackers if a leak does occur.
- Monitor API usage: Keep a close eye on the usage patterns of your API keys and cloud credentials for any unusual activity.
- Restrict permissions: Grant only the necessary permissions to your API keys and cloud accounts, following the principle of least privilege.
- Educate your team: Ensure all developers are aware of the risks of leaking credentials and best practices for secret management.
For an added layer of security when working online, especially on public Wi-Fi, consider using a VPN. IronLink VPN encrypts your internet traffic, helping to protect your data from prying eyes and enhancing your overall online safety. Learn more at https://t.me/Ironlink_VPN_bot.
Source: BleepingComputer

