Cloud keys leaked in Docker Hub images are stolen within seconds

Cloud keys leaked in Docker Hub images are stolen within seconds

Credentials and access secrets exposed in public Docker Hub images are being extracted and exploited by attackers within as little as eight seconds of publication.

Two researchers at Stony Brook University, Billy Tsouvalas and Nick Nikiforakis, measured the extraction speed by publishing a total of 300 honeypot images across eight public container registries.

Over a period of four months, the researchers exposed AWS, OpenAI, and Anthropic API keys, along with decoy SSH and database credentials.

image

They then monitored the use of these keys and placed detection tools to notify them when the images were built, ran, or had a shell opened.

Honeypot experiment overview
Honeypot experiment overview Source: containerbots.github.io

The two researchers presented the experiment and the resulting findings yesterday at the ACM Conference on Computer and Communications Security (CCS).

They noted that their images were pulled more than 75,000 times, and the planted AWS keys received over 140,000 API calls from 5,000 unique IP addresses.

The AWS traffic showed a broad pattern, from checking whether the keys worked to listing available resources, and sometimes proceeding to consume them.

The fastest observed use of a planted AWS key came 7.86 seconds after the image was published on Docker Hub. The median time for the first API call was 51.19 seconds, while all 100 AWS keys were used within 15 minutes.

API call times after image publication
API call times after image publication Source: containerbots.github.io

The exposed OpenAI and Anthropic keys were quickly hijacked to exhaust the test-account balances.

Docker Hub accounted for nearly all AWS activity, while Harbor, one of the other registries in the experiment, also saw some AWS key abuse.

The researchers dubbed the automated scanners that interacted with their test images “ContainerBots,” though this is more of a loose umbrella term, as the scans showed no evidence of being coordinated by the same operators. 

Monitoring rarely detected anyone actually running the honeypot images, which led the authors to conclude that scanners generally extracted credentials by inspecting image layers directly.

“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,” explain the researchers.

Exposing secrets this way is common in the real world [1, 2, 3], and revoking the leaked keys requires significant work and coordination.

The researchers recommend that Docker Hub scans images for secrets before pushing them live, and warn publishers if they appear to embed any secrets.

They also suggest restricting or rate-limiting access to Docker Hub’s public feed of recently published or updated images, to thwart mass-scanning tools.

Tsouvalas told BleepingComputer that they reported their findings to Docker in May, along with the full paper, but besides an acknowledgment, they received no follow-up replies.

A small-scale experiment they ran in August to determine whether any defenses had been implemented on the platform showed no changes.

Adaptive Security's AI agents analyze email intent, context, and behavior to uncover phishing, business email compromise, and invoice fraud.

See what's getting through with a 14-day read-only scan of Microsoft 365 or Google Workspace, with no MX changes.

进一步分析

免费工具,针对本文主题进一步深挖分析:

source: BleepingComputer