Skip to content

News

Security incident

Claude Code permission files exposed passwords and API keys in public GitHub repositories

Apiiro found 1,122 public Claude Code settings files on GitHub containing credentials. Approved commands can preserve passwords and API keys in plain text; affected users should rotate secrets before deleting files.

Security researchers at Apiiro reported on 5 November 2026 that 1,122 publicly accessible Claude Code settings files on GitHub contained at least one password, API key or access token. This was not a breach of Anthropic’s servers: the credentials were found in files that users had published in repositories.

How commands end up exposing secrets

Claude Code normally asks for permission before running shell commands. When a user selects “Yes, and don’t ask again”, the tool can save the approved command verbatim as a permission rule in the project file .claude/settings.local.json. If the command itself contains a database password, token or API key, that secret is stored in plain text as well.

The file can subsequently be committed to a repository. According to The Hacker News, Claude Code adds the file to a user’s global Git exclusions when it first writes it, but not to the project’s own .gitignore; that protection therefore does not travel with the project or help if the file has already been committed.

What the researchers found

Apiiro examined 104,185 public copies of the file across 103,617 repositories. It classified 1,122 copies—about 1.1 percent—as containing at least one genuine secret, with 1,379 distinct secrets in total. These included 379 database passwords, 43 SSH credentials, 42 GitHub, GitLab or npm tokens and 23 AWS keys.

The researchers did not test whether the credentials were still valid and did not claim that they had been abused. One company notified by the researchers confirmed that its exposed key had been live.

Simply deleting a visible file is not sufficient: older Git revisions and repository forks may retain copies. Apiiro recommends rotating every potentially exposed password, key and token before cleaning up, then searching repositories and their histories for .claude/settings.local.json and .claude/settings.json. Users should also remove secret-bearing permission rules locally, add the path to .gitignore, and avoid putting credentials directly into approved commands—environment variables or a secrets manager are safer alternatives.

Sources