Cybersecurity

Cloud keys leaked in Docker Hub images are stolen within seconds

The relentless speed at which modern cybercriminals and automated threat actors operate has been laid bare by a groundbreaking academic study revealing that cloud credentials and access secrets accidentally exposed in public Docker Hub images can be extracted and weaponized in less than eight seconds.

Presented at the prestigious ACM Conference on Computer and Communications Security (CCS), the research underscores a terrifying reality for software developers and enterprise security teams alike: the window of vulnerability following an accidental misconfiguration has shrunk to near-zero. Conducted over a rigorous four-month period by Billy Tsouvalas and Nick Nikiforakis, two researchers from Stony Brook University, the experiment highlights how malicious actors continuously trawl public repositories using sophisticated, automated scanning infrastructure to harvest high-value credentials before human developers even realize a mistake has been made.

The Experiment: Deploying Honeypot Images Across Public Registries

To measure the exact velocity of credential harvesting in the wild, Tsouvalas and Nikiforakis engineered a large-scale honeypot operation. The researchers created and published a total of 300 intentionally flawed container images across eight public container registries, with the vast majority concentrated on Docker Hub, the industry’s most popular repository for containerized applications.

Embedded within these decoy images were real, active, but heavily monitored credentials. These included sensitive Application Programming Interface (API) keys for major cloud and artificial intelligence infrastructure—specifically Amazon Web Services (AWS), OpenAI, and Anthropic—alongside decoy Secure Shell (SSH) keys and database authentication secrets.

Cloud keys leaked in Docker Hub images are stolen within seconds

To track how these secrets were targeted and utilized, the researchers implemented comprehensive telemetry and detection tools. These mechanisms were designed to alert the team the exact moment a honeypot image was built, executed, or interacted with via an interactive shell session, as well as whenever the embedded credentials were invoked externally.

A Flood of Automated Traffic: The Rise of "ContainerBots"

Over the course of the four-month monitoring window, the results far exceeded initial expectations. The researchers’ honeypot images were pulled more than 75,000 times by outside entities. More alarmingly, the planted AWS keys generated over 140,000 individual API calls originating from approximately 5,000 unique, globally distributed IP addresses.

The traffic directed at the AWS credentials exhibited a methodical, highly automated pattern. Threat actors utilized the stolen keys to perform reconnaissance—initially checking whether the credentials were valid, systematically listing available cloud resources to gauge the compromised environment’s value, and, in several instances, immediately proceeding to consume computing resources for illicit activities such as cryptocurrency mining or unauthorized data processing.

The velocity of the attacks shocked even the researchers. The fastest observed utilization of a planted AWS key occurred a mere 7.86 seconds after the vulnerable image was published to Docker Hub. The median time for the very first API call following publication was recorded at a staggering 51.19 seconds. Furthermore, every single one of the 100 AWS keys embedded in the test images was successfully accessed and utilized within 15 minutes of going live.

Similarly, API keys associated with generative AI powerhouses OpenAI and Anthropic were hijacked almost instantaneously. In these cases, the automated scanners quickly drained the test-account balances, redirecting expensive computing power to unauthorized third-party tasks. While Docker Hub accounted for the overwhelming majority of this malicious activity, other platforms like Harbor also registered instances of credential abuse, proving that the threat spans multiple container registry ecosystems.

Cloud keys leaked in Docker Hub images are stolen within seconds

Static Analysis Over Execution: How Scanners Operate

A critical finding of the Stony Brook study dispels a common misconception about how container images are compromised. Traditional security wisdom often assumes that attackers download and run containers locally or in sandbox environments to analyze their behavior. However, Tsouvalas and Nikiforakis discovered that the automated scanners—collectively termed "ContainerBots" by the researchers, though lacking evidence of centralized coordination—rarely ever ran the honeypot images.

Instead, monitoring tools detected virtually zero instances of containers being instantiated. The researchers concluded that the vast majority of credential extraction is performed through static analysis techniques.

"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," the researchers explained in their findings.

By leveraging the registry’s own application programming interfaces or downloading image layers directly, automated tools can inspect the uncompressed filesystem of a container image in milliseconds. This allows malicious actors to parse configuration files, environment variables, and embedded text files for known secret patterns—such as AWS access key IDs (AKIA...) or private cryptographic keys—without expending the computational overhead required to boot up a virtualized container runtime.

Industry-Wide Implications and the Burden of Revocation

Cloud keys leaked in Docker Hub images are stolen within seconds

The accidental leakage of sensitive credentials within container images is far from an isolated academic scenario; it is an endemic vulnerability in modern software supply chains. Previous industry reports from security firms have routinely highlighted tens of thousands of public Docker Hub images leaking authentication tokens, private SSH keys, and database passwords.

When enterprise credentials are exposed in this manner, the operational fallout is severe. Revoking a leaked AWS root or IAM key requires extensive forensic investigation, coordination across engineering teams, and the meticulous generation and deployment of new credentials without disrupting live production environments. For smaller organizations, the sudden weaponization of an API key can result in catastrophic financial losses due to unauthorized cloud resource billing, data exfiltration, or intellectual property theft.

Moreover, the ephemeral nature of modern development means that developers frequently commit code containing hardcoded secrets, forgetting to add configuration files to .dockerignore or failing to strip sensitive environment variables from build layers before pushing images to public repositories.

Responsible Disclosure and Platform Response

Recognizing the gravity of their findings, Tsouvalas and Nikiforakis engaged in responsible disclosure. In May, months prior to their formal presentation at the ACM CCS conference, the researchers reached out to Docker security personnel, providing them with a comprehensive overview of the experiment, the underlying methodology, and the alarming response times of automated scanners.

Despite submitting the full academic paper for review, the response from the platform was minimal. According to Tsouvalas, the researchers received a standard acknowledgment of receipt, but no substantive follow-up or indication of policy changes. Seeking to determine whether any proactive defensive measures had been quietly deployed, the research team conducted a smaller-scale follow-up experiment in August. The results showed no discernible changes in platform behavior or scanning velocity, indicating that public registries remain wide open to rapid-fire automated harvesting.

Cloud keys leaked in Docker Hub images are stolen within seconds

Recommendations for Securing the Software Supply Chain

To combat the relentless efficiency of ContainerBots and protect the broader software ecosystem, the Stony Brook researchers have proposed several targeted mitigation strategies for both developers and container registry operators.

For platform operators like Docker Hub, the researchers recommend implementing automated pre-publish security scans. By analyzing images for hardcoded secrets, API tokens, and private keys before they are made publicly accessible, registries could warn publishers and block the distribution of compromised artifacts automatically. Additionally, the authors suggest that registries consider restricting or rate-limiting access to public feeds of recently published or updated images. Because mass-scanning tools rely on monitoring real-time activity feeds to instantly identify new targets, introducing friction into these feeds could significantly disrupt the automated harvesting pipeline.

For software developers and DevOps engineers, best practices must evolve to treat security as a continuous, automated gatekeeper. Organizations are urged to integrate robust secret-scanning tools—such as TruffleHog, GitGuardian, or native CI/CD security linters—directly into their development pipelines to catch hardcoded credentials before images are ever built. Furthermore, utilizing multi-stage builds can prevent sensitive development-time secrets from persisting in final production image layers.

As automated threat actors continue to optimize their ability to exploit human error in real time, the window for remediation has effectively vanished. In the modern threat landscape, security by obscurity is dead, and the speed of automated defense must match the blistering pace of automated attack tools.

Related Articles

Back to top button