Docker Hub Secrets: Bots Used a Leaked Key in 7.86 Seconds

By 12 min read
Docker Hub secrets stolen within seconds by automated container registry scanning bots

Researchers published a container image with a working cloud key inside, told nobody, and watched. A bot used the key 7.86 seconds later.

That is the core finding of “Gone in 8 Seconds”, a Stony Brook University study presented at ACM CCS 2026: Docker Hub secrets are found and tested by automated scanners within seconds to minutes of an image going public, so any credential pushed in a public image should be treated as stolen. All 100 planted AWS keys were used within 15 minutes, and the scanners rarely even ran the containers.

Four headline figures: 7.86 seconds to first use, 51 second median, 15 minutes, over 140,000 calls.
The time between publishing a secret and losing it is measured in seconds, not days (Data: Tsouvalas and Nikiforakis, CCS 2026, as reported by BleepingComputer).

What is the “Gone in 8 Seconds” study?

It is a measurement study of credential-stealing bots on public container registries, by Billy Tsouvalas and Nick Nikiforakis of Stony Brook University. Nikiforakis’s publication list shows it as a paper in the Proceedings of the ACM Conference on Computer and Communications Security (CCS) 2026, and BleepingComputer reported that it was presented there on about 16 November 2026.

The paper itself was not publicly downloadable when this article was written: the ACM page refused automated access and the author’s site lists the PDF as not yet available. Everything below comes from press coverage that quotes the paper and the first author, mainly BleepingComputer, Malwarebytes and Dataconomy, plus a Cloud Security Alliance research note. Where those sources differ, this article says so.

Why this research matters now

Leaked secrets in images are not new. A 2023 study by Dahlmanns and colleagues at ASIA CCS analysed 337,171 images from Docker Hub and 8,076 other registries and found secrets in 8.5% of them, including 52,107 private keys and 3,158 API secrets.

What was missing was the attacker’s clock. Earlier work counted how many secrets leak. This study measured how quickly someone actually uses them, and what they do next. The answer changes how incident response should treat a leaked image.

How did the researchers set the trap?

They built honeypots, decoy systems that look valuable so that any interaction reveals an attacker. Here the decoys were container images.

  • Scale: 300 images on eight public container registries, run for four months.
  • Bait: working AWS, OpenAI and Anthropic API keys, plus decoy SSH and database credentials. The coverage gives a count only for AWS: 100 keys.
  • Monitoring: each key was tied to logging, so any use showed up in the provider’s records. The images were also instrumented to alert if anyone built them, ran them or opened a shell inside.
  • Promotion: none. Malwarebytes notes the images were never advertised, yet they were downloaded tens of thousands of times.

What is a container image, in one sentence?

A container image is a packaged filesystem made of stacked layers, and anyone can download and unpack a public one without running it. That detail turns out to be central to how the bots work.

How fast were Docker Hub secrets stolen?

Very fast. The figures below are the ones repeated consistently across BleepingComputer, Dataconomy, Malwarebytes and the CSA note.

Measure Result
Fastest use of a planted key 7.86 seconds after publication
Median time to first AWS API call 51.19 seconds
All 100 AWS keys used Within 15 minutes
Image pulls More than 75,000
API calls against the AWS keys More than 140,000
Unique source IP addresses About 5,000
OpenAI and Anthropic test credit lost About $60, all of it

Headlines rounded the fastest time to “8 seconds”; the body text of every source gives 7.86. Aviatrix’s summary rounds the median to 51 seconds.

Timeline from image publication to first key use at 7.86 seconds and all AWS keys used within 15 minutes.
AWS keys were hit almost at once, while some OpenAI keys sat idle for weeks before being drained (Data: BleepingComputer, Malwarebytes).

Which registries were hit hardest?

Docker Hub generated nearly all the AWS key activity, according to BleepingComputer and Dataconomy. Harbor, an open source registry, also recorded some AWS abuse. The other six registries are not named in any public coverage, so it is not possible to say which were ignored by the bots.

How do ContainerBots find and steal the secrets?

The researchers call the scanners “ContainerBots”. BleepingComputer stresses this is a loose umbrella term: the authors found no evidence that the bots belong to one coordinated operator. It is an ecosystem, not a single gang.

Six-step flow from image publication to static layer extraction, key validation and resource use.
The bots read images rather than run them, then validate each key before deciding whether to use it (Data: BleepingComputer, Malwarebytes, Dataconomy).

Static extraction, not execution

The instrumentation rarely fired. Few bots built or ran the images or opened shells. The researchers therefore concluded that most scanners worked by static analysis, unpacking image layers or querying the registry API to read files, in BleepingComputer’s words “without ever instantiating the container”.

This matters for defenders. Runtime security tools watch running containers. A bot that only reads layers never runs anything, so those tools see nothing. Dataconomy says monitoring “rarely” detected activity; Aviatrix’s summary goes further and says runtime detection was bypassed entirely. The more careful wording is the safer one.

How do bots notice new images so quickly?

The coverage does not fully say. The researchers recommend that Docker Hub restrict or rate-limit its public feed of recently published or updated images to slow mass scanning, which implies the feed helps scanners. Aviatrix states as fact that bots use that feed, but none of the sources that quote the paper confirm the exact discovery mechanism.

What did attackers do with the keys?

Malwarebytes, citing the paper, gives the clearest picture of attacker behaviour. The CSA note calls the pattern “validate, wait, exploit”.

Bar chart: nearly all AWS key scanners validated the key, about half stopped, about 6% kept using it.
Most scanners only checked whether a key worked; a small minority went on to spend the account's resources (Data: Malwarebytes on the study).

Step 1: validate with GetCallerIdentity

Nearly every bot that tested an AWS key began with GetCallerIdentity, an AWS Security Token Service call that returns the account number and identity behind a key. AWS documents that it requires no permissions and still works even when a policy explicitly denies it. For an attacker, it is a free, safe check that a key is live.

About half of the AWS-scanning IP addresses stopped there. BleepingComputer describes the rest of the traffic as moving from checking keys to listing available resources and sometimes consuming them. Only around 6% went on to sustained use of account resources.

Step 2: wait, possibly for a buyer

The OpenAI keys behaved differently. Some sat untouched for weeks, then one burned its remaining balance in under 24 hours. The researchers speculate that validated keys are resold and held until a buyer uses them. That is their hypothesis, and the CSA note flags it as unconfirmed.

Step 3: drain AI credit

OpenAI and Anthropic keys were used to exhaust the test accounts, about $60 in total. In a second round of tests, every key that was drained this way was unrestricted; no restricted key was abused like that. The CSA note points out this is a small sample. Stolen AI keys funding someone else’s model use is often called LLMjacking, and we covered how ARTEX AI agents steal LLM API keys to pay for themselves.

The coverage does not report crypto mining, new instances, or new IAM users in this study. Lists of those behaviours in vendor summaries describe other incidents, not this experiment.

How does this compare with other secret-leak research?

The study is the third angle on a problem other teams have measured from the defender’s side.

Study Date What it measured Key figure
Dahlmanns et al., ASIA CCS 2023 Secrets present in 337,171 images 8.5% of images held secrets
Flare, Docker Hub scan December 2025 Images uploaded in November 2025 with exposed keys 10,456 images; 75% of owners did not revoke keys
Tsouvalas and Nikiforakis, CCS November 2026 How fast planted keys are used 7.86 seconds to first use

What the Flare numbers add

Flare’s research team found 10,456 Docker Hub images with one or more exposed keys in a single month, with almost 4,000 AI model keys after filtering to high and critical findings. About 42% of affected images held five or more sensitive values.

The worrying detail: about a quarter of developers removed the leaked secret within a day or two, but Flare’s key findings say 75% did not revoke or rotate the underlying key. Combine that with a 7.86-second exploitation window and deletion alone is useless.

Images also pick up secrets from tools developers use, not just from .env files. Our report on the Claude Code secrets leak through settings.local.json shows how an AI coding assistant’s permission file ended up in public Docker images through a plain COPY . ..

Who is affected, and how do you check exposure?

Anyone who has ever pushed a public image is in scope, including old tags nobody uses. Check exposure in this order:

  1. List every public repository your organisation and its developers own on Docker Hub and other public registries, including personal accounts used for work.
  2. Scan every tag, not just latest. A secret removed in a new tag still lives in the old ones, and layers keep files that a later layer deletes.
  3. Search for the usual suspects: .env files, cloud credential files, SSH keys, database connection strings, AI provider keys and agent configuration folders.
  4. Check build history. Docker’s documentation says build arguments and environment variables persist in the final image, so secrets passed as ARG or ENV are visible to anyone who pulls it.
  5. Assume compromise for anything found. Given the study’s timings, a key in a public image is not “at risk”; it has almost certainly been tested.

How can defenders detect this activity?

Detection has to happen at the credential provider, not in the container, because the bots never run your image.

Signals to watch

  • AWS CloudTrail: AWS documents that CloudTrail logs authenticated IAM and STS API calls. A GetCallerIdentity from an unfamiliar IP or user agent, followed by list or describe calls, is the validation pattern the study describes.
  • Burst of read-only enumeration: listing resources across services shortly after a key’s first appearance from a new address.
  • AI provider usage dashboards: sudden spending or requests from unknown locations, sometimes weeks after a leak, matching the delayed use of OpenAI keys.
  • AWS quarantine policy: AWS applies a managed policy, AWSCompromisedKeyQuarantineV3, to IAM users whose credentials it finds exposed. Its description says it denies certain actions after compromise or public exposure, such as creating users and access keys or launching EC2 instances. If you see it attached, treat it as a confirmed leak, and do not remove it as a fix.

Canary tokens

The researchers’ own method doubles as a defence. A canary token is a fake credential that does nothing except raise an alert when used. Placing canary keys in images and repositories gives you the same early warning the study’s honeypots produced. The CSA note recommends this and detection of validation calls.

How do you stop secrets leaking into images?

In priority order:

  1. Rotate first. Revoke any credential found in a public image, then rebuild. Deleting the tag is not enough.
  2. Use BuildKit secret mounts. Docker’s documentation says a secret mount makes a secret available only for the duration of one build instruction, unlike ARG and ENV, which persist in the image.
  3. Write a strict .dockerignore. It excludes files from the build context, so excluded files cannot be copied in by COPY or ADD. Exclude .env, credential files and tool configuration folders.
  4. Scan before every push in CI and block the push on high-confidence findings.
  5. Scope and cap keys. Use restricted AI provider keys and hard spending limits. In the study’s second round, only unrestricted keys were drained.
  6. Prefer short-lived credentials. A token that expires in an hour is worth far less to a bot that resells keys weeks later.
  7. Plant canaries in places where real secrets might leak, so a leak announces itself.

For secrets that leak from CI rather than images, see how wfx-loot stole GitHub Actions secrets.

What should registries change?

The researchers put part of the burden on the platforms. Their two proposals, as relayed by BleepingComputer and Dataconomy:

  • Scan images for secrets before publication and warn publishers when an image appears to contain credentials. Malwarebytes words it as scanning images as they are uploaded.
  • Restrict or rate-limit access to the public feed of newly published or updated images, to slow mass scanning.

What is still unknown?

Several points are not settled by the public coverage:

  • Docker’s response. Tsouvalas told BleepingComputer that the findings and full paper went to Docker in May 2026 and Docker only acknowledged receipt. Malwarebytes and the CSA note cite the paper as saying Docker’s security team was reviewing the findings. Both agree a small test in August found no platform changes.
  • The other six registries. Only Docker Hub and Harbor are named, so we cannot say whether smaller registries are safer or simply less watched.
  • Per-type numbers. Counts and timings for OpenAI, Anthropic, SSH and database credentials have not been reported.
  • Who runs the bots. The resale theory is a hypothesis, and the authors found no single operator.
  • Primary text. Until the paper is openly available, all figures rest on journalists’ reading of it.

The bottom line

A secret pushed in a public container image is used in seconds, by bots that never run your container and leave no trace in it. Treat any leaked key as stolen, rotate it immediately, and move detection to the cloud and AI provider logs where the bots actually show up. Prevention at build time, with secret mounts, .dockerignore and pre-push scanning, is the only step that beats a 7.86-second clock.

Sources

This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.

Frequently asked questions

How fast are secrets in Docker Hub images stolen?

In the 'Gone in 8 Seconds' study presented at ACM CCS 2026, the fastest use of a planted key came 7.86 seconds after the image was published. The median time to the first AWS API call was 51.19 seconds, and all 100 AWS keys were used within 15 minutes.

What are ContainerBots?

ContainerBots is the researchers' loose umbrella term for the automated scanners that pull or inspect newly published container images to extract credentials. According to BleepingComputer, the researchers found no evidence that they are run by a single coordinated operator.

Do attackers need to run a container to steal its secrets?

No. The researchers concluded that most scanners extracted secrets by statically reading image layers or querying the registry, because their monitoring rarely saw anyone building, running or opening a shell in the images.

Does deleting a secret from a Docker image make it safe?

No. A key that was ever pushed in a public image should be treated as stolen, because bots in the study used keys within seconds. Revoke and rotate the credential, then rebuild the image without it.

Why do attackers call GetCallerIdentity first?

AWS documents that GetCallerIdentity needs no permissions and still works even if a policy explicitly denies it, so it confirms a key is live and shows its account and identity at no risk. Malwarebytes reports that nearly every bot in the study started with it.

Which registries were tested in the Gone in 8 Seconds study?

Eight public container registries were used. Public coverage names only Docker Hub, which drew nearly all the AWS key abuse, and Harbor, which also recorded some. The other six are not named in the reporting.

How do I keep secrets out of Docker images?

Pass build-time credentials with BuildKit secret mounts instead of ARG or ENV, which Docker says persist in the final image. Exclude .env and credential files with .dockerignore, and scan images for secrets before every push.

Did Docker respond to the research?

The researchers reported their findings to Docker in May 2026. BleepingComputer says Docker only acknowledged receipt, while Malwarebytes cites the paper as saying Docker's security team was reviewing the findings. A small test in August found no platform changes.

Keep reading

Docker Hub secretscontainer securitysecret scanningAWS access keysLLMjackingsupply chain securitycloud security