What's Happening?
A security vulnerability in Anthropic's Claude Code, identified by Apiiro Research, has led to the exposure of 2,539 real secrets across 1,994 public GitHub repositories. The issue stems from Claude Code's 'don't ask again' approval feature, which, when
used to execute command-line commands containing secret keys, saves these keys in a `settings.local.json` file within the `.claude` directory. If developers then commit and push this directory to public GitHub repositories, these sensitive credentials—such as database passwords, API tokens, and SSH root logins—become publicly accessible. Apiiro's scan found that approximately 2% of all repositories containing `settings.local.json` files had this issue. This problem highlights a broader challenge in software development regarding what configuration data should be committed to version control versus what should remain local and private. While Claude now actively scans for secrets before commits, this vulnerability primarily affects older generations of Claude Code and underscores the importance of robust secret scanning tools and practices in development workflows.
Why It's Important?
This vulnerability poses significant security risks for individuals and organizations using Claude Code. Exposed secrets can lead to unauthorized access to databases, cloud services, and other critical infrastructure, potentially resulting in data breaches, financial losses, and reputational damage. The incident underscores the ongoing challenge of managing sensitive information in development environments, especially with the increasing integration of AI coding assistants. It highlights the need for developers to implement strict security protocols, including pre-commit hooks and secret scanning tools like gitleaks or TruffleHog, to prevent accidental exposure of credentials. For businesses, this serves as a critical reminder to audit their codebases for exposed secrets and to educate developers on secure coding practices and configuration management. The incident also raises questions about the default behaviors of AI tools and their potential to inadvertently create security loopholes, emphasizing the need for AI developers to prioritize security-by-design principles.
What's Next?
Developers who have used Claude Code's 'don't ask again' feature should immediately review their GitHub repositories, both public and private, for any committed `.claude` directories containing `settings.local.json` files. It is crucial to rotate any exposed keys, passwords, or tokens and remove the sensitive files from version control history. Organizations should implement or reinforce automated secret scanning in their CI/CD pipelines and integrate pre-commit hooks to prevent future occurrences. Anthropic, while having implemented newer safeguards, may need to further communicate best practices or provide tools to help users identify and remediate past exposures. The broader industry may see increased adoption of security tools specifically designed to detect and prevent secret leakage in AI-assisted development workflows, and potentially new guidelines for managing AI-generated or AI-managed configuration files.
Beyond the Headlines
The incident with Claude Code's exposed secrets points to a deeper tension between developer convenience and security in the age of AI-powered development. The 'don't ask again' feature, designed to streamline workflows, inadvertently created a significant security flaw. This highlights the ethical responsibility of AI tool developers to anticipate and mitigate potential misuse or unintended consequences of their features. It also brings to light the evolving nature of software supply chain security, where AI tools themselves can introduce new vectors for vulnerabilities. The reliance on AI for code generation and assistance necessitates a re-evaluation of traditional security paradigms, pushing for more intelligent and context-aware security solutions. Furthermore, the incident underscores the human element in security—developers' habits, understanding of tool behaviors, and adherence to security best practices remain critical in preventing such breaches, even with advanced AI assistance.













