Claude Code settings files: secrets found in over 100,000 public GitHub uploads
Aktualisiert
Symbolbild
What Apiiro found on public GitHub
Security researchers at Apiiro looked at Claude Code settings files sitting in public GitHub repositories. They found thousands of secrets inside them, including database passwords, API tokens and root logins. The researchers counted more than 100,000 cases where the local settings file had been uploaded to a public repo. Of those, about 1,100, spread across 63 organizations, held secrets such as public API tokens, database passwords or private keys. The file at the center of it is `.claude/settings.local.json`, stored on the user's own machine.
How a command ends up in the file
The leak traces back to how Claude Code handles approval for automated shell commands. When you pick "Yes, and don't ask again", that choice is saved as a rule in the local settings file. Sometimes the rule is written as a pattern. Often the command itself is written into the file as is, sensitive information included. On its own, that is not a big problem while the file stays on your machine. Anthropic's documentation says this settings file is added to the developer's global .gitignore list, which usually keeps it from being shared.
Why the .gitignore does not always hold
The global .gitignore setting is not reflected at the repo level. That means the sensitive file can still be uploaded by accident, for example if a repo is cloned to another machine or a folder becomes a repo later. Apiiro writes that in many cases Claude Code commits changes to the settings file without user input. Removing a file after it is found does not always end the exposure: the secrets can persist in forks of the original project if a GitHub user is not careful.
The bug reports and the team's response
The issue was flagged in a Claude Code bug report as far back as August 2025. Other reports noted that the sensitive file was sometimes not added to the .gitignore list, or that Claude Code could write the sensitive commands to another file not protected from git sharing. Those reports were closed without action after 60 days of inactivity. In a Hacker News thread, Claude Code's Boris Cherny said the team is looking into ways to prevent it. He said these files should almost never be checked in to git source control, and that such cases seemed to come up when files were created and checked in by hand.
What Cherny suggests, and where it falls short
Cherny recommended Claude Code's auto mode, which uses classifiers to route routine permission prompts without manually keeping allow and deny lists. When another user pointed out that sensitive commands can still be saved to settings files in auto mode, Cherny called it a good catch and said the team is thinking about improvements. He also suggests secret scanners, which trawl files for sensitive data and scrub it out, and said the team was considering building that scanning into Claude Code later. Apiiro found that 215 of the roughly 1,100 public secrets in these files were not flagged by two popular secret scanners.
Affiliate-Links: Für qualifizierte Käufe können wir eine Provision erhalten, sie ändert weder unsere Daten noch die Rankings. Sie öffnen die Suchergebnisse von Amazon: Preise und Verfügbarkeit stehen dort.