Claude Code's 'don't ask again' rules left 1,379 secrets in public GitHub repos
Apiiro found 1,122 public copies of Claude Code's .claude/settings.local.json holding 1,379 distinct secrets, including database passwords, SSH logins and AWS keys, saved when developers approved a command with 'Yes, and don't ask again.'
When a developer approves a shell command in Claude Code with "Yes, and don't ask again," the tool can save that exact command, including any password or token typed into it, as an allow rule in .claude/settings.local.json inside the project. Apiiro said on November 6 that it found 104,185 copies of that file on GitHub, and 1,122 of them held at least one secret: 1,379 distinct secrets, among them 379 database passwords, 43 SSH logins for public servers, 42 GitHub, GitLab and npm tokens, and 23 AWS keys. Claude Code adds the file to the user's global git excludes but not the project's .gitignore, so the protection does not travel with the repository. Gitleaks and TruffleHog together missed 215 of the files, mostly passwords inside commands, The Hacker News reports. An earlier bug report on the behavior was closed by a bot as "not planned."
Why it matters
This is a new place for an old leak: a credential typed into a command line ends up in a config file that gets committed. Agent folders such as .claude/, .cursor/ and .gemini/ now carry the same risk as .env files, and the two common open-source scanners together missed nearly a fifth of the files that held secrets.
Search your GitHub organization, including git history and forks, for .claude/settings.local.json and .claude/settings.json. Rotate every secret they ever held first, then run git rm --cached and add the file to each repository's .gitignore. Approve command patterns rather than exact commands, and pass secrets as variables from a secrets manager instead of typing them. The technique page is secrets in repositories and CI.
Source: Apiiro, The Hacker News
Related on Start with Identity
- BlogGhostAction returns: about 1,900 hijacked GitHub accounts pushed secret-stealing workflows to 30,000 repos
GitGuardian counts more than 30,000 repositories and about 1,900 compromised GitHub accounts in GhostAction's October wave, which committed workflows that dump
- Blog4,837 hijacked GitHub accounts planted a CI secret stealer that adds cloud federated credentials
Aikido said on November 12 that an attacker used 4,837 compromised GitHub accounts from November 10 to plant a stealer that ran in at least 1,806 repositories,
- BlogGheist turns stolen GitHub tokens into secret dumps through Actions logs
Wiz reported on October 25 that the Gheist campaign used stolen GitHub tokens from infostealer logs and past supply-chain leaks to plant more than 13,500 ci-syn
- CVETrivy release and GitHub Action tags hijacked to steal CI secrets
With credentials left valid by a non-atomic rotation, an attacker shipped a malicious Trivy v0.69.4 and repointed 76 of 77 trivy-action tags to code that dumped
- CVEtj-actions/changed-files tags repointed to dump CI secrets into logs
An attacker repointed tj-actions/changed-files version tags to a commit that read the GitHub Actions runner's memory and printed its secrets into workflow logs.
- CVEOver-scoped CodeBuild GitHub token let an attacker ship code in Amazon Q Developer 1.84.0
An inappropriately scoped GitHub token in the CodeBuild configuration for the Amazon Q Developer VS Code extension let an attacker commit code that shipped auto