Configuration files generated by Anthropic’s Claude Code have exposed database credentials, API keys, and administrative access tokens across public GitHub repositories, according to security researchers at Apiiro.
The exposure originates from how the coding assistant saves user permissions for automated terminal commands. Selecting the “Yes, and don’t ask again” prompt when approving a shell command saves the command verbatim into a local configuration file named “.claude/settings.local.json”. Any sensitive credentials or authentication tokens included in that approved execution are stored directly within the file.
While Anthropic adds the file to developers’ global .gitignore configurations to block accidental sharing, that protection does not persist at the repository level. Consequently, the file is vulnerable to being pushed to remote servers when projects are cloned across different workstations, converted into repositories retroactively, or committed automatically by Claude Code itself without explicit developer oversight.
Apiiro discovered more than 100,000 public GitHub repositories containing Claude Code’s local settings file. Among those, around 1,100 instances spanning 63 organizations actively exposed sensitive assets such as private encryption keys, root logins, and database passwords. Researchers noted that even when repositories purge the exposed files, the leaked credentials frequently linger inside cloned forks.
GitHub bug reports detailing the vulnerability date back to August 2025, with multiple filings describing failures in automated .gitignore inclusion or configurations saving commands into unprotected alternate files. Those community tickets were automatically closed after 60 days without resolution.
Addressing the issue in a Hacker News discussion, Claude Code team member Boris Cherny stated that engineers are exploring preventive measures, though he noted the configuration files were designed to stay outside source control. While Cherny suggested utilizing automated permission modes or secret-detection scanners, Apiiro observed that scanning tools TruffleHog and gitleaks missed 215 of the approximately 1,100 credentials identified during their investigation.
Source: arstechnica.com



