{"id":185,"date":"2026-11-08T08:52:00","date_gmt":"2026-11-08T14:52:00","guid":{"rendered":"https:\/\/quentinpidcock.com\/content\/one-click-in-claude-code-saved-your-password-to-github\/"},"modified":"2026-11-08T08:52:00","modified_gmt":"2026-11-08T14:52:00","slug":"one-click-in-claude-code-saved-your-password-to-github","status":"publish","type":"post","link":"https:\/\/quentinpidcock.com\/content\/one-click-in-claude-code-saved-your-password-to-github\/","title":{"rendered":"One Click in Claude Code Saved Your Password to GitHub"},"content":{"rendered":"<p>I use AI coding tools in my own work, so this one got my attention fast. It is not a hack of a model and it is not prompt injection. It is a convenience button doing exactly what it says \u2014 remembering a command so it does not have to ask again \u2014 and writing that command, password and all, into a file inside your project. Researchers found more than a thousand copies of that file in public GitHub repositories, with real secrets inside. If you use Claude Code, check your repos today.<\/p>\n<h2>What happened<\/h2>\n<p>Claude Code is Anthropic&#8217;s terminal coding assistant. By default it asks before running most shell commands. If you pick &#8220;Yes, and don&#8217;t ask again,&#8221; it saves an allow rule in .claude\/settings.local.json inside the project, according to its permissions documentation. Later sessions then run matching commands without asking.<\/p>\n<p>Sometimes that rule is a pattern, and sometimes it is one exact command. When it is the exact command, any password or token typed into it is saved too, in plain text. Ask the tool to check a database and the command it proposes will often carry the password with it. Approve it once with &#8220;don&#8217;t ask again&#8221; and you have stored that password in a JSON file in your project folder.<\/p>\n<p>Security firm Apiiro published the research on November 5, and The Hacker News reported it on November 7. Apiiro searched public GitHub and found 104,185 copies of the file in 103,617 repositories. About 1.1 percent of them \u2014 1,122 copies \u2014 hold at least one secret. Together those current copies hold 1,379 different secrets.<\/p>\n<p>Counting older versions, the shared settings file, and saved agent chat logs, Apiiro puts the total at 2,539 secrets across 1,994 repositories. More than a third of the secrets in the current files open a database directly, including 379 database passwords, plus 43 SSH logins, 42 tokens for GitHub, GitLab and npm, and 23 AWS keys. They say 63 organizations own these files, and the strongest cases include a database vendor&#8217;s admin-level cloud key and the owner password of a medical-records database.<\/p>\n<h2>How bad is it, honestly?<\/h2>\n<p>For the people affected, this is serious, but I want to be precise. Apiiro did not test any of the credentials, so this proves exposure, not that every key still works. One company the researchers notified did confirm its key had been live. That is enough to treat any secret in one of these files as compromised until you rotate it.<\/p>\n<p>The protection meant to prevent this does not travel. The first time Claude Code writes the file in a repository, it adds it to your global git excludes, so git on that one computer ignores it. It never adds the file to the project&#8217;s own .gitignore. Clone on another machine, or turn a folder into a repo later, and the file can be committed like any other. In 539 of the 1,105 repositories Apiiro traced, a commit listing Claude as a co-author changed the file \u2014 the assistant itself often commits it.<\/p>\n<p>Time makes it worse. Every file with a secret was still on its repository&#8217;s default branch in the researchers&#8217; snapshot, and in half it had been there at least 217 days. Older versions hold another 734 secrets, and 211 forks carry the same secrets. Deleting the file today does not clean history or forks.<\/p>\n<p>Your scanner may not save you either. Gitleaks flagged 564 of the 1,122 files and TruffleHog flagged 643, but 215 were flagged by neither \u2014 most misses are passwords inside commands, where a password looks like an ordinary word. Users had also reported this before: a bug report from August 11, 2025, said the same thing, was closed by a bot as &#8220;not planned&#8221; in January, and the researchers say the related reports got no reply from Anthropic. I have seen no public response from Anthropic in the reporting I read.<\/p>\n<h2>What to actually do<\/h2>\n<p>First, search. Look in your GitHub account and any organization you belong to for .claude\/settings.local.json and for .claude\/settings.json, and check git history too, even where the file is now gone. Secrets also turned up in 298 of 76,011 public copies of that shared settings file.<\/p>\n<p>Second, rotate first, clean up second. Change every password, token and key those files have ever held before you tidy the repo. Removing the file does not undo a leak that reached a public repo or a fork.<\/p>\n<p>Third, untrack and ignore it properly. Stop tracking the file and add it to the project&#8217;s own .gitignore, so protection travels with the project.<\/p>\n<p>Fourth, clean your local copy even if you never committed it, and delete every rule containing a secret. The researchers note that plain JSON file can also end up inside a package, a Docker image, a zip, or a synced folder. Fifth, keep secrets out of commands: reference them as variables from a secrets manager, so a saved rule holds the variable name, not the secret, and approve patterns instead of exact commands where you can.<\/p>\n<p>My bottom line: AI tools that remember what you approved will remember your passwords too if you let them. Treat agent settings folders the way you treat .env files \u2014 assume they hold secrets, keep them out of git in the repo itself, and rotate anything that ever landed in one.<\/p>\n<p>Sources: The Hacker News, &#8220;Claude Code&#8217;s &#8216;Don&#8217;t Ask Again&#8217; File Exposes Passwords and Keys in 1,122 Public Copies on GitHub&#8221; (November 7, 2026) \u2014 <a href=\"https:\/\/thehackernews.com\/2026\/11\/claude-codes-dont-ask-again-file.html\">thehackernews.com\/2026\/11\/claude-codes-dont-ask-again-file.html<\/a>; Apiiro research as reported in The Hacker News (published November 5, 2026).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use AI coding tools in my own work, so this one got my attention fast. It is not a hack of a model and it is not prompt injection. It is a convenience button doing exactly what it says \u2014 remembering a command so it does not have to ask again \u2014 and writing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-security"],"_links":{"self":[{"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":0,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"wp:attachment":[{"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}