Claude Code accidentally leaks large numbers of keys on GitHub
Claude Code is accidentally exposing secrets all over GitHub
AI security researcher Apiiro found that Claude Code, due to negligence in handling settings files, leaked thousands of pieces of sensitive information in public GitHub repositories, including database passwords, API tokens and root login credentials. The leak stems from how Claude Code approves automatic shell commands: after a user selects "Yes, and don't ask again", that option is written as a rule to the local .claude/settings.local.json file, and the command itself is often written verbatim, potentially including sensitive information within it. If the file stayed only on the local machine, the problem would not be serious; Anthropic states in its documentation that the settings file is added to the developer's global .gitignore list, which usually prevents it from being shared publicly.
Apiiro found that thousands of secrets flowed into GitHub due to improper handling of Claude Code settings files; developers using this tool can use this to check the sharing risk of their local configuration.