Claude Code’s ‘Don’t Ask Again’ File Exposes Passwords and Keys in 1,122 Public Copies on GitHub – Slashdot

- Advertisement -spot_imgspot_img
- Advertisement -spot_imgspot_img

Be careful with the file .claude/settings.local.json, warns The Hacker News:


Passwords and API keys that developers typed into commands they approved in Claude Code are sitting in public GitHub repositories, where anyone can read them. When a user selects “Yes, and don’t ask again,” Anthropic’s AI coding assistant can save the command, word-for-word, including the secret, in a project settings file. Software security company Apiiro said that 1,122 public copies of that file hold at least one secret, though it did not test whether any still work. One company the researchers notified earlier this week confirmed its key had been live…

Removing [the file] from a project does not undo the leak, because older versions stay in git history and in forks of the repository. The researchers’ advice is to rotate first: change every password, token, and key the file has ever held, then clean up…

Claude Code tries to keep the file out of git. The first time it writes the file in a git repository, it adds the file to the user’s global git excludes, its settings documentation says. Git on that computer then ignores the file in every repository. That protection stays in one user’s git settings on one computer. It does nothing for a file that was already committed, the researchers say. Claude Code never adds the file to the project’s own .gitignore, so the protection does not travel with the project. In 539 of the 1,105 repositories the researchers traced, a commit listing Claude as a co-author changed the file. They take this to mean Claude often commits the file itself.

Apiiro’s search of public GitHub found 104,185 copies of the file in 103,617 repositories, its research write-up shows. About 1.1% of them, or 1,122 copies, hold at least one secret. Together they hold 1,379 different secrets… ]And “in half of those repositories it had been there for at least 217 days.”] More than a third of the secrets open a database directly, including 379 database passwords. Others include 43 SSH logins for public servers, 42 tokens for GitHub, GitLab and npm, and 23 AWS keys. Among the owners of these files are 63 organizations, mostly software companies of all sizes. The strongest cases include a database vendor’s own admin-level cloud key and the owner password of a medical-records database, the researchers say.
Boris Cherny, Anthropic’s head of Claude Code, responded to the story in a comment on Hacker News:


“Historically Claude Code has not done secret scrubbing (there are many good tools for that), but we are looking into what we can do to prevent this.

That said, a few thoughts:

1. .claude/settings.local.json is meant to stay local. This is not a file you should check into source control. We automatically gitignore it when Claude creates the file, so in this case the files were manually created and checked in (docs: https://code.claude.com/docs/en/settings)

2. Permission rules are old hat. Everyone should be using auto mode instead. It is safer and also does not require manually maintaining finicky allow/deny lists. Auto mode is enabled by default and is included for free in all plans.

3. Regardless of what agent you use, you should have secret scanning enabled. GitHub and other source control hosts offer it. There are many threat models that it protects against and you should absolutely use it if you can. (see https://github.com/security/plans)”

Cherny also named approaches Anthropic plans to prototype, Apiiro notes in an update, citing Cherny’s goal of
“making sure auto mode catches this, building in basic secret scanning,” and, when a reader noted the same can happen in auto mode when it asks about a sensitive command, answered “good catch.”

Claude Code users had already filed a bug report on the issue on August 11, 2025, notes The Hacker News, but “An automated bot closed that report as ‘not planned’ on January 3, after 60 days without activity.”

Three more bug reports were then filed, according to the researchers. “None got a reply from Anthropic, and three were closed automatically as inactive or duplicate.”

Source link

- Advertisement -spot_imgspot_img

Highlights

- Advertisement -spot_img

Latest News

- Advertisement -spot_img