Apiiro Finds Secrets in 1,122 Public Claude Code Settings Files

· Original article ↗

Summary

Apiiro found secrets in 1,122 public copies of Claude Code’s settings.local.json. Researchers did not test whether most remain valid; one notified company confirmed its key was live. Git history and forks can retain the files.

Key points

  • Selecting “Yes, and don't ask again” can save an approved command verbatim in .claude/settings.local.json, including passwords or tokens typed into it.
  • Apiiro found 104,185 copies of the file across 103,617 public repositories; 1,122 copies contained at least one secret, totaling 1,379 distinct secrets.
  • One company notified by researchers confirmed its key had been live. Researchers did not test whether the other secrets still worked.
  • The file is excluded through a user's global Git settings, but that protection does not apply to files already committed; deleting a file does not remove it from Git history or repository forks.
  • Researchers found 734 additional secrets in older file versions across 509 repositories; 211 forks of 74 repositories carried the same secrets as their originals.
  • Of 1,122 secret-bearing files, Gitleaks flagged 564 and TruffleHog flagged 643; neither flagged 215. Plain-text passwords in commands were a common reason scanners missed secrets.
  • Researchers recommend rotating every password, token, and key the file has held before cleaning up exposed copies.

Article Details

Publisher
The Hacker News
Scope
Apiiro's analysis of exposed Claude Code settings files and secrets in public GitHub repositories.
Sample Size
104,185 copies of .claude/settings.local.json across 103,617 public GitHub repositories.
Key Statistics
  • 1,122 of 104,185 copies (about 1.1%) contained at least one secret; the researchers identified 1,379 distinct secrets.
  • The researchers identified 734 additional secrets in older file versions across 509 repositories that were absent from current copies.
  • Including shared settings files, older versions, and saved agent chat logs, the researchers counted 2,539 secrets across 1,994 repositories.
  • Of 1,122 files containing a secret, gitleaks flagged 564 and TruffleHog flagged 643; neither tool flagged 215.
Recommendations
  • Rotate every password, token, and key the file has ever contained, then clean up the exposed files.

Malware

Vendors

Products

Tools

Industries

Related Articles