All news

Apiiro finds 2539 secrets in public repositories due to saved Claude Code commands

Prepared by Sintelligent with the help of SI. Published in SI: . Updated: .

Persistently approving a command can silently turn a password into a settings entry and publish it with the code; secrets should be passed through variables and replaced after any such exposure.

When a user selects "Yes, and don't ask again", Claude Code saves the approved command in `.claude/settings.local.json` inside the project. If the command contains a password, token or connection string, the secret is recorded in plain text. Claude Code adds the file to the computer's global Git exclusion list, but not to the repository's own `.gitignore`, so the protection does not apply to other copies of the project or to files already being tracked. Apiiro found 104,185 public copies of the file: 1122 contained at least one secret. Including Git history, shared settings, agent logs and other files, the researchers counted 2539 unique secrets in 1994 repositories, including database passwords, cloud keys and SSH access. The secrets were not tested for validity; one notified organization confirmed that its key had been active. The researchers recommend replacing affected credentials first, then removing the rules and adding the file to the project's exclusions, while using environment variables instead of secrets in commands.