Home › News › Cybersecurity
Cybersecurity

Anthropic's Claude Code Leak Exposes Active Passwords and API Keys in Public GitHub Repositories

S
Published November 08, 2026 at 12:00 AM
2 min read 17 views
Anthropic's Claude Code Leak Exposes Active Passwords and API Keys in Public GitHub Repositories

A major security oversight by Anthropic's AI coding assistant, Claude Code, has resulted in thousands of sensitive API keys, passwords, and tokens being inadvertently leaked into public GitHub repositories.

⚡ Key Takeaways
  • Core Development: Software security firm Apiiro discovered 1,122 public copies of the configuration file containing at least one unencrypted secret.
  • Technical Shift: The tool stores exact shell commands in .claude/settings.local.json when users select the 'don't ask again' permission prompt.
  • Industry Impact: Developers must immediately rotate all exposed credentials, as simply deleting the local file fails to purge historical commits and repository forks.

The Anatomy of the Credential Leak

Security researchers at Apiiro revealed that when developers authorize shell execution in Claude Code using the persistent approval option—selecting 'Yes, and don't ask again'—the application saves the exact command executed in plain text. If a developer typed a database password, cloud provider API key, or authentication token directly into the terminal prompt, that sensitive string is permanently recorded inside the .claude/settings.local.json file.

Scanning public code hosts, Apiiro identified 104,185 total copies of the settings file across 103,617 repositories. Out of that total, approximately 1.1%—representing 1,122 files—contained a combined total of 1,379 unique credentials. When tested, at least one major enterprise confirmed that its exposed production key remained entirely active until researchers issued a warning.

"Removing the configuration file from a project does not undo the leak, because older versions remain permanently embedded within git history and repository forks."

Breakdown of the Git Exclusion Failure

The core architectural vulnerability stems from how Claude Code attempts to handle version control exclusions. While the coding assistant automatically updates the user's global git excludes file upon initial creation, it fails to append .gitignore rules directly inside the project directory. Consequently, if a developer manually stages files or if Claude itself commits changes—traced in 539 of the 1,105 analyzed repositories via co-author signatures—the sensitive configuration file is pushed directly to remote public servers.

The issue has been successfully reproduced across recent iterations including models Opus 5.5 and Fable 5.1, demonstrating that automated code assistants can inadvertently subvert standard secure development workflows if credential sanitization is missing from the command-line interface.

Industry Outlook & Next Steps

As organizations rush to audit their codebases, security analysts strongly advise development teams to initiate a comprehensive credential rotation protocol. Developers should immediately invalidate every password, token, and API key ever processed by the assistant before attempting to scrub repository histories. Moving forward, AI tool providers must implement strict runtime string filtering to intercept and redact secrets before configuration files are ever generated on local disk.

Original report published on: https://thehackernews.com/2026/11/claude-codes-dont-ask-again-file.html