Detection queries Not classified

Apiiro finds Claude Code settings.local.json secrets in 1,122 public GitHub copies

Apiiro (published Nov 5, 2026; updated Nov 8) searched public GitHub from Nov 1 to Nov 3, 2026, and found 104,185 copies of .claude/settings.local.json in 103,617 repositories. Of those, 1,122 files (1.1…

What happened

Apiiro (published Nov 5, 2026; updated Nov 8) searched public GitHub from Nov 1 to Nov 3, 2026, and found 104,185 copies of .claude/settings.local.json in 103,617 repositories. Of those, 1,122 files (1.1 percent) held at least one secret the researchers counted, 1,379 distinct secrets in that file alone: 636 provider-format keys and 743 passwords or tokens next to a public host. The count includes 379 database passwords, 122 Supabase service-role keys, 43 SSH logins for public servers, 42 GitHub, GitLab, and npm tokens, 23 AWS keys, and 6 private keys. Adding history, the shared .claude/settings.json file, and saved agent transcripts brings the total to 2,539 distinct secrets in 1,994 repositories. The mechanism is Claude Code's own permission prompt. If the user picks Yes, and don't ask again, the allow rule stored in the project file can be the exact command, so a password after PGPASSWORD= or sshpass -p is written in plain text. Apiiro reproduced that with Opus 5.5 and Fable 5.1. The first time Claude Code creates the file inside a git repository it adds the path to the user's global git excludes. That rule stays on one computer, does not cover a folder that becomes a repository later, and is never written to the project's .gitignore. If the file is already tracked, later approvals are appended and the user is not told. In 539 of 1,105 repositories with a secret that Apiiro traced, a commit co-authored by Claude changed the file. On Nov 2, 2026 every secret-bearing copy Apiiro checked was still on the default branch. The median repository had first committed it 217 days earlier. Deleting the file left 734 further secrets in history across 509 repositories, and 211 forks of 74 repositories carried the same secrets. gitleaks flagged 564 of the 1,122 files and TruffleHog 643. Neither flagged 215. Apiiro names 63 organizations and says one confirmed a notified key had been live. No credential was tested. Boris Cherny, head of Claude Code, wrote on Hacker News on Nov 7 that the team was looking at auto mode and basic secret scanning, and that he believed exposed copies had been created manually. A separate SANS Internet Storm Center diary by Manuel Humberto Santander Peláez (July 13, 2026) records internet scans for /.claude/settings.local.json, /.claude/mcp.json, and /.cursor/mcp.json on an ordinary web host. That diary does not attribute the scans to this GitHub corpus.

Choosing Yes, and don't ask again can save the exact approved shell command, secret included, in .claude/settings.local.json. Claude Code adds that path to the user's global git excludes, not to the repository .gitignore.

Read the original sourceAdditional source: Someone Is Scanning for Your MCP Servers and AI Assistant Credentials

How it happened

Select a stage to explore its defenses
Detect this stage
Detect this stage
Detect this stage
Detect this stage
Select a stage · Drag to explore · + / − to zoom · Dashed edges are loopsSelect a stage · Arrows show reported connectionsReported sequence
Read the flow as text & sources

A catalog reconstruction of the supplied source account. Unknown steps remain explicit; an edge describes the reported relationship between steps.

  1. 01 · Yes, and don't ask again

    Claude Code proposes a shell command that already contains a secret from config or .env. The user approves that exact command for good.

    Hunt: An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.

    Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.

    Source for step 1
  2. 02 · The command is saved in settings.local.json

    The allow rule can be the full command line. Global git excludes hide the file on that one computer and are not written into the repository .gitignore.

    Hunt: A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.

    Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.

    Source for step 2
  3. 03 · The file is committed

    In 539 of 1,105 traced repositories with a secret, a commit co-authored by Claude changed the file. History and forks keep copies after deletion.

    Hunt: A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.

    Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.

    Source for step 3
  4. 04 · 1,122 public copies hold a secret

    Apiiro counted 1,379 secrets in current copies and 2,539 once history, shared settings, and transcripts are included. A July 2026 ISC diary also shows scans for this path on web servers.

    Hunt: An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.

    Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.

    Source for step 4

Why it matters

Reported entry point: A developer approves an exact Claude Code shell command that contains a secret. The settings file is later committed, or was already tracked, so the secret is in a public repository and its history. Reported impact: Apiiro counted 1,379 secrets in current copies and 2,539 once history, shared settings, and transcripts are included. A July 2026 ISC diary also shows scans for this path on web servers; reported targets include 63 organizations with a counted secret in a public allow list, plus individual developers. Apiiro's table includes a database vendor, a medical-records application, and other software companies. No organization is named; applicability to your setup has not been assessed, so verify affected versions, permissions, and configuration in the original report.

Read the original report

What you can do

Protection & prevention

Search the organization for .claude/settings.local.json and .claude/settings.json, including git history, and rotate every secret those files ever held before deleting them. Add the local file to each repository .gitignore. Approve command patterns instead of one exact command, and reference secrets as variables such as $DB_URL so the saved rule does not hold the value. Scanners that only match known key formats miss passwords after PGPASSWORD=, sshpass -p, and mysql -p.

Catalog defensive guidance based on the reported behavior. Confirm scope and current mitigations in the original source.

Review the original guidance Additional source 2
Investigate each phase

Detection queries

Draft query starters grouped by the attack stages where they apply.

Download stage pack

Start with the logs you collect. Each hunt identifies its required visibility, field mapping and limits. Queries are catalog-authored drafts using reusable behavior profiles; test with known activity and your normal baseline before alerting.

01Yes, and don't ask againSensitive store access → credential useCustom schema · Draft

Claude Code proposes a shell command that already contains a secret from config or .env. The user approves that exact command for good.

What to look for

An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.

Visibility: Defender-side logs where collected

Required logs

  • File-read / API access telemetry for relevant secret stores
  • Process identity and command lines
  • Identity, token and outbound-network audit logs

Coverage limit. Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Sensitive store access → credential use
id: 46c46c62-2d83-4198-a8bf-d6637094527b
status: experimental
description: An unexpected process or tool accesses credential stores and is
  followed by token use or outbound transfer inconsistent with the owner.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - secret.read
      - credential.store.read
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("secret.read", "credential.store.read")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("secret.read", "credential.store.read")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Identify the actor, process and exact store touched, then pivot to token use from new devices or infrastructure.
  2. Correlate reads with egress and rotate affected credentials after confirming exposure.
02The command is saved in settings.local.jsonPrivate access → public repository artifactCustom schema · Draft

The allow rule can be the full command line. Global git excludes hide the file on that one computer and are not written into the repository .gitignore.

What to look for

A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.

Visibility: Defender-side logs where collected

Required logs

  • Git-provider organization / enterprise audit
  • Repository and token permission inventory
  • Agent tool and secret-scanning / DLP records

Coverage limit. Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Private access → public repository artifact
id: b7b2d3f0-8170-4225-accb-c20633364ef4
status: experimental
description: A token or agent reads private material and creates a public issue,
  repository, commit or visibility change inconsistent with the approved task.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - repository.public.write
      - repository.visibility.change
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("repository.public.write", "repository.visibility.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("repository.public.write", "repository.visibility.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join access and public-write actions by actor / token and time; inspect visibility changes and newly created repositories.
  2. Verify whether the artifact contains sensitive data using approved scanning, retaining original source qualifications.
03The file is committedPrivate access → public repository artifactCustom schema · Draft

In 539 of 1,105 traced repositories with a secret, a commit co-authored by Claude changed the file. History and forks keep copies after deletion.

What to look for

A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.

Visibility: Defender-side logs where collected

Required logs

  • Git-provider organization / enterprise audit
  • Repository and token permission inventory
  • Agent tool and secret-scanning / DLP records

Coverage limit. Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Private access → public repository artifact
id: b7b2d3f0-8170-4225-accb-c20633364ef4
status: experimental
description: A token or agent reads private material and creates a public issue,
  repository, commit or visibility change inconsistent with the approved task.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - repository.public.write
      - repository.visibility.change
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("repository.public.write", "repository.visibility.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("repository.public.write", "repository.visibility.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join access and public-write actions by actor / token and time; inspect visibility changes and newly created repositories.
  2. Verify whether the artifact contains sensitive data using approved scanning, retaining original source qualifications.
041,122 public copies hold a secretSensitive store access → credential useCustom schema · Draft

Apiiro counted 1,379 secrets in current copies and 2,539 once history, shared settings, and transcripts are included. A July 2026 ISC diary also shows scans for this path on web servers.

What to look for

An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.

Visibility: Defender-side logs where collected

Required logs

  • File-read / API access telemetry for relevant secret stores
  • Process identity and command lines
  • Identity, token and outbound-network audit logs

Coverage limit. Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Sensitive store access → credential use
id: 46c46c62-2d83-4198-a8bf-d6637094527b
status: experimental
description: An unexpected process or tool accesses credential stores and is
  followed by token use or outbound transfer inconsistent with the owner.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - secret.read
      - credential.store.read
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("secret.read", "credential.store.read")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("secret.read", "credential.store.read")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Identify the actor, process and exact store touched, then pivot to token use from new devices or infrastructure.
  2. Correlate reads with egress and rotate affected credentials after confirming exposure.
Technical detailsTooling, impact & MITRE ATLAS

Attack context

AI's role
AI credential theft
Initial access
A developer approves an exact Claude Code shell command that contains a secret. The settings file is later committed, or was already tracked, so the secret is in a public repository and its history.

Tooling as reported

AI products, models and artifacts

  • Claude Code permission prompt, Yes and don't ask again
  • .claude/settings.local.json and shared .claude/settings.json
  • Opus 5.5 and Fable 5.1, used when Apiiro reproduced the save

Other tooling

  • git global excludes, which do not travel with the repository

Targets and reported impact

Targets / sectors
63 organizations with a counted secret in a public allow list, plus individual developers. Apiiro's table includes a database vendor, a medical-records application, and other software companies. No organization is named.
Reported scale / exposure
104,185 public copies, 1,122 with a counted secret, 1,379 secrets in the current file, 2,539 secrets across 1,994 repositories once history, shared settings, and transcripts are included. 539 of 1,105 traced repositories had a Claude co-authored commit touching the file.

Apiiro does not name the countries of the 63 organizations. Public GitHub is not a victim region.

Reported attribution

No named actor for the GitHub copies. The exposure is Claude Code writing secrets into a file that git then publishes. The July 2026 ISC diary documents separate scanning for the same paths.

Structured attribution

Actor
unknown
Motivation
unknown
Attributed by
Apiiro
Attribution confidence
low

Detection rules

  • settings.local.json secrets are a repository search, not a host ruleGUIDANCE

    No cited endpoint rule matches a git commit of .claude/settings.local.json. Search organizations for that file and for .claude/settings.json, including history. gitleaks and TruffleHog, run by Apiiro without their verification step, missed 215 of the 1,122 files, mostly passwords inside PGPASSWORD=, sshpass -p, and mysql -p. The July 2026 ISC diary is a web-root scan for the same path, which is a different place than a GitHub commit.

Activity timeline

First seen
2025-08-11
Last updated
2026-11-08

Updates

  • 2025-08-11 — Apiiro

    Apiiro cites a Claude Code issue, filed this day, that described approved commands with tokens being stored in settings.local.json. Later issues were closed without an Anthropic reply.

  • 2026-07-13 — SANS Internet Storm Center

    Manuel Humberto Santander Peláez records scans for /.claude/settings.local.json and related MCP config paths on a small web host.

  • 2026-11-02 — Apiiro

    Organization notices go out Nov 2 and 3. Every secret-bearing file Apiiro checked was still on the default branch.

  • 2026-11-05 — Apiiro

    Apiiro publishes the GitHub census, 1,122 files and 2,539 secrets across all sources they counted.

  • 2026-11-08 — Apiiro

    The post adds Boris Cherny's Nov 7 Hacker News reply. He said the team was looking at auto mode and basic secret scanning.

Source defensive notes

Search the organization for .claude/settings.local.json and .claude/settings.json, including git history, and rotate every secret those files ever held before deleting them. Add the local file to each repository .gitignore. Approve command patterns instead of one exact command, and reference secrets as variables such as $DB_URL so the saved rule does not hold the value. Scanners that only match known key formats miss passwords after PGPASSWORD=, sshpass -p, and mysql -p.

MITRE ATLAS

AI-specific catalog annotations based on the reported behavior; these are not MITRE case-study assignments.

AML.T0055Unsecured Credentials

Yes, and don't ask again can store the approved command, including a password or token, in the project settings file Source

AML.T0010.001AI Software

The file is written by Claude Code and then committed, including in commits Apiiro says were co-authored by Claude Source

Sources & research credit

2 sources

Research by Apiiro · Apiiro

  1. Coding Agents Are Leaking Your Secrets to GitHub apiiro.com
  2. Someone Is Scanning for Your MCP Servers and AI Assistant Credentials isc.sans.edu

Counts, dates, the git-exclude behavior, the scanner gap, and Boris Cherny's Nov 7 comment are from the Apiiro post. Organization names are not in that post and are not added here. The July 13, 2026 path list is from the SANS ISC diary by Manuel Humberto Santander Peláez. The diary does not say those scans started the weekend of the Apiiro post.

Record & downloads
Source record name
Apiiro finds Claude Code settings.local.json secrets in 1,122 public GitHub copies
Entry ID
apiiro-claude-code-settings-local-secrets-2026-11
Catalog review
November 15, 2026
Category
attacks-on-ai
AI involvement confidence
confirmed