Apiiro: Claude Code "don't ask again" rules leak up to 2,539 secrets from public GitHub settings files
Matéria consolidada. Reúne 4 matérias que o Tifon tinha publicado separadamente sobre a mesma história. A IA reescreveu o relatório com o que as 3 fontes trouxeram em 09/11/2026 00:01; os links antigos trazem para cá.
Fontes: securityonline.info ↗ gbhackers.com ↗ thehackernews.com ↗
Application-security vendor Apiiro published research on 5 November 2026 showing that the "Yes, and don't ask again" approval option in Claude Code (Anthropic) can save a full shell command, credentials included, as an allow rule in .claude/settings.local.json. Developers then commit that file to public GitHub repositories. Apiiro scanned 104,185 public copies of the file between 1 and 3 November 2026 and found 1,379 distinct secrets in 1,122 files, and 2,539 secrets across 1,994 repositories once git history, forks, the shared settings.json and agent chat transcripts are counted (thehackernews.com, gbhackers.com, securityonline.info). The secrets affect 63 organizations, mostly software companies, which Apiiro notified on 2 and 3 November (securityonline.info). Apiiro did not verify whether the credentials still work, but one notified organization confirmed its key was live (thehackernews.com, gbhackers.com, securityonline.info). No exploitation of these specific secrets has been reported. No CVE has been assigned and no Anthropic advisory or public statement had been found as of 8 November (gbhackers.com, securityonline.info). The behaviour reportedly remains unchanged up to Opus 5.5 (securityonline.info). This is a configuration and developer-hygiene exposure, not a classic product vulnerability. The risk is still real: the files stayed exposed for a long time (half of the affected repositories for at least 217 days on the default branch), and infostealers and supply-chain worms already hunt for developer credentials (gbhackers.com).
Detalhes técnicos
- Mechanism: by default Claude Code asks before running most shell commands. Choosing "Yes, and don't ask again" writes an allow rule to
.claude/settings.local.json. The rule is sometimes a pattern such asnpm test *and sometimes the exact command. In the exact-command case, any password or token typed into it is stored in cleartext (thehackernews.com). The command may contain credentials taken from configuration files or supplied during troubleshooting (gbhackers.com). - Reproduction: the researchers, Apiiro's Shmulik Cohen and Matan Giladi (gbhackers.com, securityonline.info), reproduced the behaviour with the latest models, Opus 5.5 and Fable 5.1.
- Why git protection fails: on first write in a git repository, Claude Code adds the file to the user's global git excludes. That protection is local to one machine and one user, is never added to the project's
.gitignore, and does nothing for files that are already committed. It also fails when a folder becomes a repository later or is cloned to another machine (pasqualepillitteri.it via securityonline.info). In 539 of 1,105 traced repositories, a commit listing Claude as co-author modified the file, so the agent often commits it itself (thehackernews.com, securityonline.info). - Dataset: 104,185 public copies of the file in 103,617 repositories. About 1.1% contain a secret: 1,122 files holding 1,379 distinct secrets (636 provider-format keys and 743 passwords or tokens tied to public hosts) (thehackernews.com, gbhackers.com). Apiiro defined a real secret as one matching a known provider format, or a password paired with a public host, after filtering placeholders and expired tokens. It did not test any credential or contact any host (securityonline.info).
- Secret types: 379 database passwords, 122 Supabase service-role keys, 103 Supabase account tokens, 43 SSH logins to public servers (including root logins in
sshpasscommands), 42 GitHub/GitLab/npm tokens, 23 AWS keys and six private keys (thehackernews.com, gbhackers.com). A categorization from securityonline.info lists 398 service API tokens, 379 database passwords, 149 AI model API keys, 122 Supabase service-role keys, 110 Google API keys, 103 Supabase account tokens and 43 SSH logins. Among the worst cases it names a database vendor's admin-level cloud key, a Square production token and the owner password of a medical-records database. - Extra exposure: deleted copies still expose 734 more secrets across 509 repositories via git history. 211 forks of 74 repositories replicate the secrets. 298 of 76,011 copies of the deliberately shared
.claude/settings.jsonalso contain secrets (thehackernews.com). Exposed configuration files were also observed on Hugging Face Spaces and GitLab (securityonline.info). - Persistence: as of 2 November, every secret-bearing file was still on its repository's default branch (gbhackers.com).
- Scanner gaps: run without verification, gitleaks flagged 564 of the 1,122 files and TruffleHog 643. Neither flagged 215, because passwords after
PGPASSWORD=,sshpass -p,mysql -por incurlheaders match no known key format (thehackernews.com, securityonline.info). - Prior reports: users had reported the mechanism in GitHub issues since August 2025 (#5544, #11982, #13106, #91270) without a reply (securityonline.info).
- Comparison: of 16 coding agents whose documentation was compared, Claude Code is the only one confirmed to save the full approved command in a project file by default (thehackernews.com).
- Wider reach: the plain JSON file can also ship inside other artifacts, such as an npm package (thehackernews.com, text truncated).
Remediação
The sources give no vendor fix. Defenders can draw these steps from the findings:
- Treat any credential that appeared in a Claude Code approved command as compromised and rotate it first, clean up afterwards. Removing the file is not enough, because git history, clones and forks keep copies (securityonline.info).
- Search repositories and developer machines for
.claude/settings.local.jsonand.claude/settings.json, and check history, forks and published packages. - Untrack the file with
git rm --cachedand add the file, or the agent configuration folders, to the project's own.gitignoreor repository template, since the automatic global exclude does not travel with the repository (securityonline.info). - Reference credentials through environment variables instead of typing them inline in commands (securityonline.info).
- Do not approve exact commands containing secrets with "don't ask again".
- Add scanner rules for password-in-argument patterns such as
PGPASSWORD=,sshpass -pandmysql -p.
Relatos divergentes
- Secret count: thehackernews.com leads with 1,379 secrets in 1,122 files. Its technical section, the gbhackers.com headline and securityonline.info give 2,539 secrets across 1,994 repositories. The figures cover different scopes: 1,379 is current
settings.local.jsonfiles on default branches, and 2,539 adds git history, forks,settings.jsonand, per securityonline.info, agent chat transcripts. They are not a true contradiction. - Validity of the secrets: the securityonline.info headline calls them "live" secrets. thehackernews.com and gbhackers.com say Apiiro did not test the credentials, and securityonline.info's own text says no credential was tested. gbhackers.com stresses that its "real secret" classification means credible material, not verified validity. Only one notified organization confirmed a live key, so "live" is unconfirmed in general.
Linha do tempo
-
Apiiro finds 2,539 live secrets exposed in 1,994 public GitHub repos via Claude Code settings.local.json allowlists
ler a análise desta fonte ocultar
Researchers at Apiiro reported that Claude Code's permission allowlist mechanism has leaked credentials into 1,994 public GitHub repositories. When a developer picks "Yes, and don't ask again" for a proposed shell command, the agent stores the literal command string — including any inline password or token — as an allow rule in
.claude/settings.local.jsoninside the project folder. Scanning 104,185 public copies of the file between 1 and 3 November 2026, Shmulik Cohen and Matan Giladi found 1,379 distinct secrets on default branches across 1,122 active files, rising to 2,539 real secrets once git history, shared settings files and agent chat transcripts were included. Apiiro published the study on 5 November 2026 (pasqualepillitteri.it, dev.to) and notified the 63 affected organisations on 2 and 3 November; at least one confirmed its exposed key was live. The behaviour in Anthropic's coding tool remains unchanged up to Opus 5.5 and no vendor advisory or public Anthropic statement on the issue was found at the time of writing.Technical Details
The exposed material includes 398 service API tokens, 379 database passwords, 149 AI model API keys, 122 Supabase service-role keys, 110 Google API keys, 103 Supabase account tokens and 43 SSH logins; among the worst cases were a database vendor's admin-level cloud key, a Square production token and the owner password of a medical-records database. Claude Code adds the file to git's global exclude list the first time it writes it in a repository, but that rule never reaches the project's own
.gitignore, so the protection fails when a folder becomes a repository later or is cloned to another machine (pasqualepillitteri.it). Commits co-authored by Claude modified the secret-bearing file in 539 of the 1,105 traced repositories. Conventional secret scanners are weak against this pattern: gitleaks and TruffleHog missed 215 of the 1,122 exposed files, because they key on structured provider prefixes rather than plain passwords typed insidePGPASSWORD,sshpassorcurlheaders. Exposed configuration files were also observed on Hugging Face Spaces and GitLab. The researchers did not test any credential or contact any host, defining a real secret as one matching a known provider format or a password paired with a public host, after filtering placeholders and expired tokens. Users had reported the mechanism in GitHub issues since August 2025 (#5544, #11982, #13106, #91270) without a reply.Remediation
Search repositories and developer machines for
.claude/settings.local.jsonand.claude/settings.json; where a secret is found, rotate it first and clean up afterwards, since deleting the file leaves the value in git history, clones and the 211 public forks identified. Untrack the file withgit rm --cached, add agent configuration folders to the repository.gitignoretemplate, reference credentials through environment variables such as$DB_URLinstead of inline passwords, and extend pre-commit scanners to catch inline command passwords as well as standard provider tokens. -
Apiiro finds 2,539 secrets exposed in 1,994 public GitHub repos via Claude Code "Don't Ask Again" settings files
ler a análise desta fonte ocultar
Application-security vendor Apiiro published research on 5 November 2026 showing that Claude Code's "Yes, and don't ask again" approval option can persist a full shell command — credentials included — as an allowlist rule in
.claude/settings.local.json, which developers then commit to public repositories. Apiiro counted 2,539 distinct secrets across 1,994 public GitHub repositories, including production database passwords, cloud credentials, API tokens and SSH logins, affecting 63 organizations; one notified organization confirmed its exposed key was live. The research was authored by Apiiro's Shmulik Cohen and Matan Giladi (itwire.com), who say they reproduced the behaviour with the latest models, Opus 5.5 and Fable 5.1, and that of 16 coding agents whose documentation they compared, Claude Code is the only one confirmed to save the full approved command in a project file by default (thehackernews.com). This is a configuration and developer-hygiene exposure rather than a product vulnerability: no CVE has been assigned and Anthropic has published no advisory on the matter; Apiiro did not test the credentials, so its "real secret" classification indicates credible material, not verified validity. The operational risk is nonetheless real, as infostealers and supply-chain worms already scan developer workstations for credentials and for Claude Code authentication artifacts.Technical Details
The leak starts when Claude Code proposes a command containing credentials pulled from configuration files or supplied during troubleshooting. Choosing persistent approval stores the literal command as an allow rule instead of stripping its sensitive arguments. Claude Code adds the file to the developer's global git excludes the first time it writes it in a repository, per its settings documentation, but that protection lives in one user's git configuration on one machine, does nothing for an already-committed file and is never written to the project's own
.gitignore(thehackernews.com). In 539 of 1,105 traced repositories, a commit listing Claude as co-author changed the file, suggesting the agent frequently commits it itself (thehackernews.com).Across 104,185 public copies of
.claude/settings.local.jsonin 103,617 repositories, Apiiro found 1,122 files holding 1,379 distinct secrets — 636 provider-format keys and 743 passwords or tokens tied to public hosts. Database access dominated: 379 database passwords, 122 Supabase service-role keys and 103 Supabase account tokens, plus 43 SSH credentials (including root logins embedded insshpasscommands), 23 AWS keys and six private keys. Historical versions of deleted files contain 734 further secrets across 509 repositories, 211 forks of 74 repositories replicate the credentials, and 298 of 76,011 shared.claude/settings.jsonfiles also carry secrets (thehackernews.com). As of 2 November, every secret-bearing file was still on its repository's default branch, present for at least 217 days in half of them (thehackernews.com). Detection tooling was unreliable: Gitleaks flagged 564 secret-bearing files and TruffleHog 643, while neither flagged 215 — passwords followingPGPASSWORD=,sshpass -pormysql -plack recognizable provider prefixes.Remediation
Search the organization for
.claude/settings.local.jsonand.claude/settings.json, including in git history where the files were deleted. Rotate every credential the files have ever held before cleanup, since deletion does not undo historical and fork exposure. Untrack the local file (git rm --cached) and add it to the repository's own.gitignore, then purge rules containing secrets from local copies even when never committed. Replace literal secrets with secret-manager-backed environment-variable references (e.g.$DB_URL) and approve command patterns such asBash(npm run:*)instead of exact commands (thehackernews.com). Add pre-commit and CI scanning able to detect passwords embedded inside command lines, and check npm package contents, Docker images and archives that may ship the file. -
Apiiro: Claude Code "don't ask again" allow rules leak 1,379 secrets in 1,122 public .claude/settings.local.json files on GitHub
ler a análise desta fonte ocultar
Software security company Apiiro reported that 1,122 public copies of Claude Code's project settings file
.claude/settings.local.jsonon GitHub contain at least one secret, totalling 1,379 distinct secrets. The exposure comes from the assistant's "Yes, and don't ask again" permission prompt: when the approved item is an exact shell command rather than a pattern, Anthropic's agent stores the command verbatim — including any password or token typed into it — in plain text. Apiiro found the file in 103,617 repositories (104,185 copies), with roughly 1.1% holding a secret; it did not verify whether the credentials still work, although one notified company confirmed its key was live. More than a third of the secrets grant direct database access (379 database passwords), alongside 43 SSH logins to public servers, 42 GitHub/GitLab/npm tokens and 23 AWS keys, affecting 63 organisations, mostly software companies. No exploitation of these specific secrets is reported, which keeps operational urgency below critical, but the long exposure window — half the affected repositories had the file on their default branch for at least 217 days — makes credential compromise plausible.Technical Details
By default Claude Code prompts before running most shell commands; choosing "Yes, and don't ask again" writes an allow rule into
.claude/settings.local.jsonin the project, per its permissions documentation. The rule covers only what the prompt offered: sometimes a pattern such asnpm test *, sometimes a single exact command, in which case embedded credentials are persisted in cleartext. The researchers reproduced the behaviour with the latest models, Opus 5.5 and Fable 5.1. On first write inside a git repository the tool adds the file to the user's global git excludes, a protection that is machine-local, does not travel with the project (it is never added to the repository.gitignore) and does nothing for already-committed files. In 539 of 1,105 traced repositories a commit listing Claude as co-author modified the file, suggesting the agent frequently commits it itself. Deleted copies still expose 734 further secrets across 509 repositories via git history, and 211 forks of 74 repositories replicate the originals' secrets; 298 of 76,011 copies of the deliberately shared.claude/settings.jsonalso contain secrets, bringing the total to 2,539 secrets across 1,994 repositories. Common scanners miss much of this: run without verification, gitleaks flagged 564 and TruffleHog 643 of the 1,122 files, and neither flagged 215, because passwords afterPGPASSWORD=,sshpass -pormysql -pdo not match known key formats. Of 16 coding agents whose documentation was compared, Claude Code is the only one confirmed to save the full approved command in a project file by default. The researchers note the exposure is not limited to GitHub: the plain JSON file can also ship inside an npm package, a Docker image, a zip archive or a synced folder, and credential-stealing malware already targets developer machines — in September 2025 the Shai-Hulud worm ran TruffleHog on infected hosts.Remediation
Apiiro recommends rotating every password, token and key the files have ever held before cleanup, since deletion does not undo exposure in history or forks. Search the organisation for
.claude/settings.local.jsonand.claude/settings.json, including git history where the files are gone; stop tracking the local file withgit rm --cached .claude/settings.local.jsonand add it to the repository's own.gitignoreand to organisational.gitignoretemplates. Open the file on local machines and delete rules containing secrets. Keep secrets out of commands by referencing variables from a secrets manager (e.g.$DB_URL), and approve patterns such asBash(npm run:*)rather than exact commands. Security teams should treat agent folders (.claude/,.cursor/,.gemini/,.specstory/) and agent memory files like.envfiles, add them to pre-commit and CI secret scanning with detection for passwords inside command lines, and triage first the credentials paired with a public server address. A bug report filed on 11 August 2025 described the same verbatim storage of API keys; it was closed as "not planned" by an automated bot on 3 January after 60 days of inactivity, and the four related reports cited by the researchers have all been closed by the same bot without a reply from Anthropic.