Security0 views

Claude Code Security Flaw Exposes User Credentials on GitHub

Claude Code has a security vulnerability that stores sensitive credentials in plain text when users authorize command execution. When developers select "Yes, and don't ask again" to run commands containing passwords or tokens, the model records these credentials directly into a rule within the .claude/settings.local.json file.

While Claude Code adds this file to the user's global .gitignore on first edit, the protection has significant limitations. It doesn't prevent exposure if another user accesses the repository, and it offers no protection if credentials were already pushed before the file was added to .gitignore. Researchers discovered 2,539 exposed credentials across 1,994 repositories, highlighting the scale of the problem. The vulnerability underscores the risks of storing authentication information locally without robust safeguards, especially in shared development environments.