Claude Code is leaking sensitive information on public GitHub instances thanks to a partial oversight in the way its settings files are handled. Thatâs the finding of AI security researchers at Apiiro, who discovered thousands of secrets, including database passwords, API tokens, and root logins, amid Claude Code settings files embedded in GitHub repositories.
The leak stems from the way Claude Code handles user approval for automated shell commands. When a user chooses the âYes, and donât ask againâ option to approve running a command, that choice gets stored as part of a rule in the local â.claude/settings.local.jsonâ file on the userâs computer. That rule is sometimes coded as a pattern, but the command itself is often written to that settings file as is, including any sensitive information that may be embedded within it.
This isnât really a significant security issue if the settings file stays on the userâs local machine (assuming that machine doesnât become compromised itself, of course). And Anthropic notes in its Claude Code documentation that this particular settings file gets added to the developerâs global .gitignore list, which usually prevents it from being shared publicly.
But that .gitignore setting isnât reflected at the repo level, meaning the sensitive file can be uploaded accidentally if a repo is cloned to another machine or a folder becomes a repo later, for instance. In many cases, Claude Code itself will commit changes to the settings file without the userâs input, Apiiro writes.
A breakdown of the kinds of secrets Apiiro found in publicly shared Claude Code settings files.
A breakdown of the kinds of secrets Apiiro found in publicly shared Claude Code settings files. Credit: Apiiro
Apiiroâs researchers found over 100,000 cases where Claude Codeâs local settings file had been uploaded to a public GitHub repository. Of these, only about 1,100 from 63 different organizations contained secrets such as public API tokens, database passwords, or private keys. Even after these files are discovered and removed from a repository, the secrets can persist in forks of the original project if a GitHub user isnât careful.
Source: Ars Technica · Kyle Orland
At a glance
- Topic
- Technology
- Country
- đșđž US
- Publisher language
- EN
- Added to Allnira