Claude Code settings files have exposed secrets on public GitHub repositories
AI security researchers at Apiiro found thousands of exposed secrets in Claude Code settings files stored in public GitHub repositories. The material included database passwords, API tokens and root logins. The findings concern a way the tool records approvals for automated shell commands.
When a user selects “Yes, and don’t ask again,” Claude Code saves the approval as a rule in the local .claude/settings.local.json file. The rule may use a pattern, but the command is often written into the file unchanged. Any sensitive information included in that command can therefore be recorded alongside the rule.
Keeping the file on the user’s computer does not generally create a major exposure by itself, unless the machine is compromised. Anthropic’s Claude Code documentation says the file is added to the developer’s global .gitignore list, which normally prevents it from being published. The reported exposures occurred when the settings file was nevertheless included in repositories made public on GitHub.
Written by Sakhanda Wire AI from reporting by Ars Technica. Facts, quotes and full context are in the original article below.