Every Docker image tells a story, but most developers don't realize how much of that story is written in the .git directories they accidentally ship. Analyzing public Docker Hub images, we found more than a million layers that embed a full .git repository. Each is an unintended archive: source code, full commit history, author identities, and hard-coded secrets. Hundreds of thousands of images ship a .git/config with a credential. Beyond those, we recovered more than 90,000 secrets straight from the git object store, loose objects and packfiles alike. Over 7,000 are still valid, and one in three appears in no file, in no image, anywhere else. In tens of thousands of images the credential is still live and the repository it points to is private or gone. The image is the only public copy of that code, one docker pull away. This is the first large-scale study of .git exposure on Docker Hub.
We cover: how git commit metadata enables identity attribution at scale; how hundreds of self-hosted git hostnames surface in images their owners published themselves; and how ephemeral CI tokens (GitHub Actions ghs_ and GitLab CI job tokens) embedded in git configs can be raced to confirm live access before they expire. We close with the fixes any developer can apply: keep the credential out of .git, keep .git out of the image, and mint short-lived tokens that cannot be re-shipped.
Prior Presentations at CanSecWest:
About the Presenter: Guillaume Valadon
Guillaume Valadon is a the head of cybersecurity researcher at GitGuardian and holds a PhD in networking. He likes looking at data and crafting packets. In his spare time, he co-maintains Scapy and learns reversing embedded devices. Also, he still remembers what AT+MS=V34 means! Guillaume regularly gives technical presentations, classes and live demonstrations, and write research papers for conferences and magazines. He is the editor-in-chief of the MISC magazine.

