Claude Code Security Flaw Discovered
AI security researchers at Apiiro have identified that Claude Code is leaking sensitive information on public GitHub instances due to a partial oversight in how its settings files are handled.
The Scale of the Leak
The researchers discovered thousands of secrets embedded within Claude Code settings files found in GitHub repositories. These secrets included database passwords, API tokens, and root logins.
How the Leak Occurs
The vulnerability stems from the way Claude Code manages user approval for automated shell commands.
- When a user selects the "Yes, and don't ask again" option to approve running a command, that choice is stored as part of a rule in the local file, ".claude/settings.local.json" on the user's computer.
- This rule is sometimes coded as a pattern, but the command itself is often written to that settings file exactly as is.
- This practice allows sensitive information to be embedded directly within the settings file.
Security Context and Mitigation
The security implications depend on the file location. This issue is not considered a significant security problem if the settings file remains on the user's local machine, assuming that machine is not compromised.
Anthropic has taken steps to mitigate this risk. They note in its Claude Code documentation that this particular settings file is added to the developer's global .gitignore list, which generally prevents it from being shared publicly.
Source
arstechnica.com
This story summarizes reporting from the publisher. Read the full piece at the source.
Written by
Hintsphere Staff
Writes for the Hintsphere desk.