NEWS · CODING · #4036
Claude Code's 'Don't Ask Again' feature stored credentials in local settings and exposed secrets
Agentic security firm Apiiro found Claude Code saved approved shell commands as permanent rules in a local settings file (.claude/settings.local.json), which sometimes contained embedded credentials and was committed or left in repos and images; Apiiro identified thousands of exposed secrets and GitGuardian later reported 31,088 occurrences on public GitHub (5,343 still valid) plus 613 in Docker Hub images. Apiiro recommends untracking and .gitignoring the file, rotating affected credentials, deleting rules that contain secrets, and avoiding typing secrets directly into commands.
KEY POINTS
- Agentic security firm Apiiro found Claude Code saved approved shell commands as permanent rules in a local settings file (.claude/settings.local.json), which sometimes contained embedded credentials and was committed or left in repos and images; Apiiro identified thousands of exposed secrets and GitGuardian later reported 31,088 occurrences on public GitHub (5,343 still valid) plus 613 in Docker Hub images.
- Apiiro recommends untracking and .gitignoring the file, rotating affected credentials, deleting rules that contain secrets, and avoiding typing secrets directly into commands.
- Because the feature creates a predictable local file that can contain live credentials and is easy to miss with scanners, it materially increases the risk of credential leakage across many projects and machines.
WHY IT MATTERS
Because the feature creates a predictable local file that can contain live credentials and is easy to miss with scanners, it materially increases the risk of credential leakage across many projects and machines.