Skip to content
/
Suscribirse Subscribe

Claude Code’s `.claude/settings.local.json`: How One “Don’t Ask Again” Click Leaked 31,088 Secrets to GitHub and Docker Hub

Claude Code auto-approve persisted plaintext keys in .claude/settings.local.json, spilling 31,088 secrets on GitHub and 613 across Docker Hub.

Developer laptop on a pull-out industrial server rack tray with a red hardware token, braided patch cable, and printed hex strip

(🇪🇸 Leer la versión en español aquí)

Terminal coding agents save you keystrokes until they automate something nobody wants automated: persisting plaintext production credentials inside project config files. Telemetry published this week by GitGuardian — following Apiiro's November 5 disclosure detailed via Aviatrix — puts hard numbers on the Claude Code .claude/settings.local.json leak: 31,088 distinct secrets across 23,276 public GitHub repositories, including 5,343 valid, live credentials at the time of detection.

Even worse, Git wasn't the end of the pipeline. Because COPY . . in a Dockerfile copies the entire working directory regardless of .git/info/exclude, 613 secrets (99 live/valid) ended up baked directly inside public Docker Hub image layers — including a single valid Cloudflare API token replicated across 559 public Docker image tags.

Why “Yes, and Don’t Ask Again” Saved Plaintext Keys to Disk

Nothing here requires an exotic zero-day. It is pure, predictable permission-UX leakage:

  1. Agent suggests a credentialed command: While debugging an n8n instance, cloud API, or PostgreSQL database, Claude Code generates a curl or CLI command embedding a live token or password.
  2. Literal string allowlisting: Clicking "Yes, and don't ask again" tells Claude Code to store a permanent allow rule in .claude/settings.local.json containing the verbatim command string — plaintext credential included.
  3. Broken ignore boundaries (Git and Docker): When .claude/settings.local.json was missing from repo-level .gitignore and .dockerignore files, git add . and docker build packaged production secrets straight into public registries.
Leak Telemetry Dimension Verified Scope Production Reality Primary Source
Public GitHub exposure 31,088 secrets across 23,276 repos 5,343 credentials verified active/valid when scanned GitGuardian
Initial Apiiro enterprise sample 2,539 secrets across ~2,000 repos (63 orgs) Exposed production DB passwords, cloud keys & root SSH keys Aviatrix / Apiiro
Docker Hub layer leaks (COPY . .) 613 secrets (99 valid) Single live Cloudflare API token shipped in 559 Docker tags GitGuardian
Monthly leak trend (2026) Peaked Apr 2026 (12,535) -> 959 in Oct (-92%) New leaks dropped sharply, yet legacy Git history & image layers stay exposed GitGuardian
Minimalist 2D dark-mode infographic showing the 3-step auto-approve leak into settings.local.json and public GitHub or Docker Hub vs .gitignore and env isolation

Four Guardrails Every Team Using CLI Coding Agents Needs Today

While GitGuardian's data shows monthly new occurrences fell 92% between April and October 2026, any agentic CLI (Claude Code, Codex, Cursor) with shell access triggers the exact same failure mode if you don't enforce boundaries:

  • Enforce .claude/ inside BOTH .gitignore and .dockerignore: Keeping local ignores in .git/info/exclude does nothing to stop COPY . . during container builds.
  • Never allowlist commands containing literal secrets: Pass credentials via runtime environment variable expansion ($API_TOKEN) or short-lived OIDC/secret-manager wrappers, never inline literals.
  • Rotate anything that ever touched .claude/settings.local.json: Deleting the file in a later commit won't erase Git history or cached Docker Hub layers. When rotating burned DB passwords and API secrets, generate unbiased high-entropy keys offline in your browser with zero server uploads via our Password Entropy & WebCrypto Generator in Syncroma Tools.

Visuals and infographics designed by Syncroma Studio.

Newsletter Newsletter

Sistemas reales, sin humo corporativo Real systems, zero corporate hype

Recibe los análisis a fondo sobre arquitectura, consumo de recursos y computación de bajo nivel directamente en tu bandeja de entrada. Get deep-dive software architecture, resource consumption metrics, and low-level computing essays delivered straight to your inbox.

Suscribirse a Syncroma Subscribe to Syncroma
Suscribirse Subscribe