Back to AI News
Ars Technica AI

Claude Code settings files found leaking secrets on GitHub

Security researchers at Apiiro found thousands of secrets, including database passwords, API tokens, and root logins, in Claude Code settings files embedded in public GitHub repositories. The exposure stems from Claude Code storing approved shell commands in the local .claude/settings.local.json file, sometimes including sensitive information written directly into the command. Anthropic's documentation says this settings file is added to the global .gitignore list, which usually prevents public sharing.

AI Brief

It alerts developers using Claude Code to a concrete secret-exposure risk in local settings files and the need to audit repositories and gitignore rules.

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.

Read full article

Comments

claude-github-leaks-1152x648.jpg
Be the first to rate this article.

Comments & Questions (0)

Captcha
Please be respectful — let's keep the conversation friendly.

No comments yet

Be the first to comment!