STUPID-2026-0167

Claude Code's "Yes, and don't ask again" permission saves raw command strings into settings.local.json — GitGuardian found 31,088 leaked secrets across 23,276 public GitHub repos, 5,343 still valid

8.0high
November 11, 2026

Why 8/10

Mass, public-scale exposure across tens of thousands of repositories and hundreds of Docker image repos — scope 4. Many secrets were still live when found, but the report does not say how much was ultimately rotated, so recoverability sits at partial loss rather than total. This is a research scan of existing public exposure rather than a single reported victim incident, matching the "demonstrated, no named victim" band used for the comparable Copilot secret-regurgitation finding (STUPID-2026-0047) rather than "happened in real use." Credentials are explicitly in scope for impact, capping it at 1.

Scope
4/4
Many organisations or the public: a flaw in a widely used product, mass exposure, a large outage
Recoverability
2/3
Partly lost, or loss reported without saying whether it was recovered
Did it happen
1/2
Demonstrated (proof of concept, reproduction, controlled test or near-miss) with no real victim reported
Beyond the user
1/1
Production systems, customers or third parties, or credentials and sensitive personal data

The score is the sum of these four factors. How each factor is scored · scored 2026-11-16

  1. Instruction given

    None — no single task triggers this. It results from Claude Code's standard approval flow: a developer runs a shell command that needs permission and selects "Yes, and don't ask again" to avoid re-approving it every session.

  2. Expected behavior

    An approval rule meant to skip re-confirming a command's shape should never persist the literal argument values typed into that command, and a project-level config file capable of holding credentials should be excluded from version control everywhere it is used, not just on the machine that first wrote it.

  3. Actual behavior

    When a developer picks "Yes, and don't ask again," Claude Code writes the full command string — including any literal secret typed into it, such as an API key in a curl header — as an allow rule into the project-level `.claude/settings.local.json` file. Security researcher Guillaume Valadon at GitGuardian found 31,088 distinct secrets inside that file across 23,276 public GitHub repositories, with 5,343 still valid when detected. A separate scan of public Docker Hub images found another 613 secrets (99 valid) baked into settings files across 543 image repositories and 7,625 tags, because Docker's `COPY .` ignores `.gitignore` unless a matching `.dockerignore` entry exists. Claude Code does add the file to the user's global git-ignore list on first write, but that protection is local to the machine that wrote it — the file can still be committed from another clone, a fork, or a CI checkout.

  4. Damage

    Of the secrets GitGuardian could check, 67% were working, live credentials. Database passwords were the largest category at 2,280 distinct credentials, ahead of cloud-provider and AI-service tokens. One Cloudflare API token turned up in 559 separate Docker image tags; a database password appeared in 643 tags across seven image repositories. Monthly new leaks of this file peaked at 12,535 occurrences in April 2026 before falling to 959 by October — the report does not say why. GitGuardian said Claude Code's lead, Boris Cherny, acknowledged the issue and was exploring fixes including built-in secret scanning, but no shipped fix existed as of the report.

Full write-up

Claude Code's permission system lets a developer approve a shell command once and never be asked again — a convenience that, it turns out, writes the command verbatim into a project file. Pick "Yes, and don't ask again" on a command carrying a real credential, and that credential is now saved in plain text to .claude/settings.local.json, a file many developers don't think to treat as a secret store. GitGuardian researcher Guillaume Valadon scanned public GitHub and found 31,088 distinct secrets sitting in that file across 23,276 repositories, 5,343 of them still valid and usable. The leak doesn't stop at git: because Docker's COPY . instruction ignores .gitignore, the same file turns up baked into public container images too — 613 more secrets, 99 of them valid, spread across 543 image repositories and thousands of tags, including one Cloudflare token present in 559 tags and a database password in 643. Claude Code quietly protects against this on the machine that first saves the file, by adding it to that machine's global git-ignore list — but that's a per-machine setting, not a per-file one, so the same project cloned, forked, or checked out in CI starts from zero protection. Two-thirds of the secrets GitGuardian could test were live. Anthropic hadn't shipped a fix as of this report, though GitGuardian says Claude Code lead Boris Cherny acknowledged the problem and was looking at options including built-in scanning.

Classification

Root cause
Other
Domain
Security

Related incidents

Cite this record
StupidLLM. "STUPID-2026-0167: Claude Code's "Yes, and don't ask again" permission saves raw command strings into settings.local.json — GitGuardian found 31,088 leaked secrets across 23,276 public GitHub repos, 5,343 still valid." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0167/ (accessed 2026-11-17). CC BY 4.0.

← STUPID-2026-0166By IDSTUPID-2026-0168 →

Get told when an agent breaks something

We document AI agent failures daily, severity-scored against a published scale. Each Monday, if any scored 7 or above that week — deleted data, leaked secrets, broken production — you get one email with the sources. When nothing did, you get nothing.

This database is callable over MCP — query it from inside your agent.