Claude Code permission files leak thousands of secrets from public repositories and Docker images
- Severity
- High
- Sources
- 1
What happened
GitGuardian found 31,088 distinct secrets in .claude/settings.local.json files across 23,276 public GitHub repositories, with 5,343 still valid when detected. When a developer picks "Yes, and don't ask again", Claude Code stores the full command string, including any embedded credentials, as an allow rule in that file. A further 613 secrets were found in public Docker Hub images, 99 of them valid, because COPY instructions pulled the file in and Docker does not respect .gitignore. Anthropic's Claude Code lead said the company is exploring built-in secret scanning and an auto mode.
For IT people · Written by AI from 1 source · Wrong?
What to do
- Rotate any credentials that appear in Claude Code settings.local.json files, since removing the file from a repository does not revoke them.
- Remove .claude/settings.local.json from Git and from Docker build contexts, and exclude it through .dockerignore.
- Check previously published container images for leftover secrets and rebuild them without the file.
- Use environment variables instead of hardcoding credentials into commands.
Written by AI from the sources, checked against them
Full story timeline · 1 update
Who reported · 1 outlet
Who and what is in it
Companies
Products