Every Docker Layer Ships, Including the One With Your Keys
TL;DR: Deleting a secret from a Docker image doesn’t remove it. The earlier layers ship with the image, and anyone who pulls it can read them. In July 2026, we added Docker Hub to our public monitoring service. Since then we have found over 24,000 unique verified secrets, 2,927 of these secrets were unique to Docker, meaning these were not found across other sources we scan. This includes cloud credentials, database passwords and AI tokens. In one AMD image, a deleted shell history still held a working Databricks token, next to Hugging Face tokens and saved Cursor agent chats.
Why Docker Hub?
Our research team runs TruffleHog around the clock against the places developers publish code: everything new pushed to GitHub, plus GitLab, npm, PyPI, Hugging Face datasets, Android apps and Firefox add-ons. In July, we added Docker Hub. Docker Hub is a popular container registry platform, developers publish and download images that run applications and infrastructure. Currently, Docker Hub’s public search catalog shows that roughly 13.6 million public images exist. Back in March 2024 Docker reported 25 billion image pulls per month, that’s a lot!
We test every secret we find against its provider, so every number in this post is a key that worked when we found it. Finding them is half the job. Our Secrets Revocation Program sends them to the companies that issued them to be revoked.

Docker images vary wildly in size, some contain small HTTP servers whilst others can be complete system binaries. Because of this we needed a way to efficiently scan Docker images for secrets using TruffleHog.
Scanning Efficiently
In October, our Docker scanning pipeline processed 5.78 petabytes of decompressed data, averaging about 186 terabytes of data per day.
We follow recently updated and newly created repositories and resolve the latest tags to make sure we are only scanning the image / tag version once. To effectively do this, we implemented a shared cache for layers that we had already scanned. Because Docker images are commonly made up of the same layers, this meant we saved a lot of compute minimising duplicate scans.
Cache Shared Layers
A Docker image is built from layers, each layer records filesystem changes such as installing a runtime, adding application files or copying environment files. Each layer has a digest, which is a cryptographic fingerprint calculated from its content.
Different images often share the same layers. Two releases of an image might use the same runtime and dependencies, with only the application content changing. We keep a shared cache of layer digests so we can recognise content we have already collected. Before downloading a layer, we check its digest. If that layer is already in the cache, we skip the download.
Let’s look at an example of 2 image versions that have 30 layers in common. Version A adds six layers, while Version B adds two different layers. We can skip downloading the 30 layers we have already collected and focus on the layers that are different and may contain secrets.

Across three of the 30 shared layers we found three unique verified secrets: a Hugging Face token, a Google Gemini Key and a DetectLanguage API key. Version A also contained a set of AWS credentials in an additional, unshared layer. Caching lets us skip content that we have already seen whilst checking layers that are different.
During October, we extracted more than 4 petabytes of Docker image content. Our shared layer cache currently contains approximately 82.9 million unique layer digests. This shared cache helped us avoid processing another 27.1 million duplicate layers, an estimated additional 2.2 terabytes of data. This not only saves thousands of dollars in compute but also ensures that we are catching secrets as soon as possible inside new and updated images.Our shared cache currently contains approximately 82.9 million unique layer digests. During October we extracted more than 4 petabytes of Docker image content. Our shared layer cache avoided processing another 27.1 million duplicate layers, while image caching skipped 33.4 million repeat image scans. This not only saved us thousands of compute dollars but also ensures that we are catching secrets as soon as possible inside new and updated images.

What we found
We started scanning Docker in July 2026, since then we have processed 10.78 million distinct image manifests across 510,193 unique repositories. A repository being the org / repo name of the image on Dockerhub.
In October alone, we scanned 4.03 million manifests from 249,770 repositories and found 8,349 unique verified secrets. Of those, 2,927 were unique to our public monitoring dataset, meaning these secrets were not found across the other sources we scan.

The findings for October span database credentials, cloud credentials, developer tools, applications services and AI services.

Case Study 1
Public monitoring discovered three Hugging Face tokens and a Databricks token across either public tags for a docker image published by AMD.
The Databricks token was stored in a /root/.bash_history file. It was confirmed active by TruffleHog at the time of the scan and authenticates as an amd.com identity with indirect workspace-admin membership.

The Hugging Face tokens appeared in image environment metadata and saved Cursor transcripts. One token has a write role, its account had read access to AMD’s Hugging Face organization and the amd-gendigital resource group. Another token persisted across five tags of the same image.



The images also contained conversations between a user and a Cursor agent, including internal engineering plans, customer references, delivery commitments and other engineering related information. This isn’t the first time we have seen secrets leak inside directories that contain agent conversations and it likely isn’t the last.
We analysed the image layers and found a later layer that deleted the visible shell history and the Cursor directories. The original files were still recoverable however, via an earlier layer. Deleting them from the final published filesystem had still left the credentials and transcripts in the published public image.

The Hugging Face tokens were disclosed via our Secrets Revocation Program were immediately revoked as we discovered them. We also reported the Databricks token to AMD, which has now been revoked.
Where do secrets leak in Docker?
We analysed the file paths that contained secrets in the Docker findings. Not surprisingly, .env variants contained the most unique secrets at around 27%. JSON files also contained a hefty chunk: 5,479 unique verified secrets, or around 22%. Git internals contained 3,635, around 15%.
We also found secrets in JavaScript, TypeScript, Python, YAML, and text files. Build history contained 862 unique verified secrets. These findings cover 18 July to 5 November 2026. A secret can appear in several locations, so the counts and percentages overlap.

Why public monitoring matters
Engineers are expected to move fast, and AI tools help them move faster. Mistakes still happen. Your organization might be monitoring private repositories for secrets, but are you checking public sources too?
Truffle Security monitors public sources for your organization’s exposed secrets, including Docker images and public repositories. We find and verify leaked credentials so your team can act before someone else finds them and exploits them.


