Definition
Docker image secrets leakage occurs when credentials embedded in Dockerfile RUN commands, ENV variables, or build arguments persist in image layer history — recoverable via docker history even after credential rotation.
Key Points
- Baseten case:
GITHUB_TOKENARG expanded in RUN → visible inhistory[].created_by(2026-09-15-baseten-github-pat-security-breach) - Old images in registries, CI caches, and developer laptops retain secrets indefinitely
- Mitigation: BuildKit
--secretmounts, runtime credential injection, scoped short-TTL tokens - TruffleHog and similar scanners detect secrets in pulled image layers