{"id":8679,"date":"2026-11-07T21:24:16","date_gmt":"2026-11-07T21:24:16","guid":{"rendered":"https:\/\/lockitsoft.com\/?p=8679"},"modified":"2026-11-07T21:24:16","modified_gmt":"2026-11-07T21:24:16","slug":"ai-coding-assistant-claude-code-leaks-passwords-and-api-keys-into-public-github-repositories","status":"publish","type":"post","link":"https:\/\/lockitsoft.com\/?p=8679","title":{"rendered":"AI Coding Assistant Claude Code Leaks Passwords and API Keys Into Public GitHub Repositories"},"content":{"rendered":"<p>A widespread software security vulnerability has exposed thousands of sensitive credentials, including enterprise database passwords, cloud infrastructure keys, and developer authentication tokens, through the automated operations of Anthropic\u2019s AI coding assistant, Claude Code. According to findings published by software security firm Apiiro, user-approved shell commands containing plain-text secrets have been persistently saved into local configuration files and inadvertently pushed to public repositories on GitHub. <\/p>\n<p>The security flaw highlights the growing, often overlooked attack surface introduced by autonomous AI agents in software development pipelines. As development teams increasingly delegate terminal operations, code reviews, and environment setups to large language models, the boundary between local machine state management and global version control systems has blurred with severe consequences.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/lockitsoft.com\/?p=8679\/#The_Mechanics_of_the_Leak_How_Claude_Code_Stores_Secrets\" >The Mechanics of the Leak: How Claude Code Stores Secrets<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/lockitsoft.com\/?p=8679\/#Apiiro_Research_Findings_and_Scope_of_Exposure\" >Apiiro Research Findings and Scope of Exposure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/lockitsoft.com\/?p=8679\/#Industry_Comparison_and_Uniqueness_of_the_Flaw\" >Industry Comparison and Uniqueness of the Flaw<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/lockitsoft.com\/?p=8679\/#Detection_Challenges_and_Downstream_Supply_Chain_Risks\" >Detection Challenges and Downstream Supply Chain Risks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/lockitsoft.com\/?p=8679\/#Timeline_and_Disclosure_History\" >Timeline and Disclosure History<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/lockitsoft.com\/?p=8679\/#Mitigation_Strategies_and_Remediation_Recommendations\" >Mitigation Strategies and Remediation Recommendations<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"The_Mechanics_of_the_Leak_How_Claude_Code_Stores_Secrets\"><\/span>The Mechanics of the Leak: How Claude Code Stores Secrets<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The exposure stems from how Claude Code manages user permissions and shell execution. By default, the AI assistant prompts developers for confirmation before running most shell commands. When a developer selects the prompt option reading &quot;Yes, and don&#8217;t ask again,&quot; Claude Code saves an automated allow-rule inside a project-specific settings file located at <code>.claude\/settings.local.json<\/code>. <\/p>\n<p>This functionality is designed to streamline development workflows by allowing matching commands to execute automatically in subsequent sessions without constantly interrupting the user. However, the software saves these rules verbatim\u2014capturing the exact string entered by the developer. If a developer types a command containing an explicit password, database connection string, or API token\u2014such as an environment variable assignment or a command-line database login\u2014that sensitive string is written directly in plain text to the local JSON configuration file.<\/p>\n<figure class=\"article-inline-figure\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhZH3vYLZb9lP7mDLqy2h-upzdComeWIfjDX5siFUO3FM2HlUs03OTwirA1R2uzOZq_clptIVBsoaJNXIuf8LlTbXHFvzBJLRl1l3mqGVesHjgdmD86S_c-k2JY_t56xZqI0bnN6jXRDr92KlMw6X5BHzm5hqogpWflsERi9zrsMHSS_abAcvZMcUGovd8\/s1700-nu-rw-lo-l85-e365\/claude-code.jpg\" alt=\"Claude Code&apos;s \u201cDon&apos;t Ask Again\u201d File Exposes Passwords and Keys in 1,122 Public Copies on GitHub\" class=\"article-inline-img\" loading=\"lazy\" \/><\/figure>\n<p>Although Claude Code implements a safeguard to prevent this file from being pushed to version control, the protection mechanism has notable limitations. Upon creating the file within a Git repository for the first time, Claude Code attempts to add it to the user&#8217;s global Git excludes file on their local machine. Consequently, Git ignores the file on that specific developer workstation. <\/p>\n<p>However, this protection fails to travel with the project repository. It does nothing to prevent the file from being committed if global excludes are misconfigured or overridden, nor does it secure files that were already committed or shared across team environments. Apiiro\u2019s researchers discovered that in roughly half of the affected repositories, a Git commit listing Claude itself as a co-author had modified the configuration file, indicating that the AI tool frequently commits the files directly during its automated workflows. Furthermore, deleting the configuration file from a project does not purge historical data; previous versions persist indefinitely within the repository&#8217;s Git history and any public forks.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Apiiro_Research_Findings_and_Scope_of_Exposure\"><\/span>Apiiro Research Findings and Scope of Exposure<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Apiiro\u2019s comprehensive analysis of public GitHub repositories revealed a massive scale of accidental data exposure. Researchers scanned public code repositories and identified over 104,000 copies of the <code>.claude\/settings.local.json<\/code> file across more than 103,000 repositories. Out of these files, approximately 1.1 percent\u2014totaling 1,122 configuration files\u2014contained at least one valid or functional secret, aggregating to 1,379 distinct sensitive credentials.<\/p>\n<p>The leaked data spans a wide array of high-value targets. Over a third of the uncovered secrets grant direct access to backend data systems, including 379 plain-text database passwords. Additional compromised credentials include 43 Secure Shell (SSH) login credentials for public-facing servers, 42 authentication tokens for platforms like GitHub, GitLab, and npm, and 23 Amazon Web Services (AWS) administration and access keys. <\/p>\n<p>The scope of affected entities encompasses at least 63 distinct organizations, ranging from early-stage startups to major enterprise software vendors. Among the most critical discoveries were administrative-level cloud infrastructure keys belonging to a prominent database vendor, as well as master access passwords for a sensitive medical-records database. <\/p>\n<figure class=\"article-inline-figure\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi9hjzSN2bSutSbaNO6ZWEm02wC6hue03kC4VKPSfsdPvcDX2PAvPE-u9QrLCw3POvN3hXFPlyYyFgkAgtKrs4I2oSb9BkIFOWQ_k1ISfIBdT2AoWNvq2Q2DF_3AyA4fJriKPHkTjqYFxu-Y_H4IH9uqscX8lh-puQ5cPmc_veAEr9p4fC0497XT8Fktlp6\/s728-nu-rw-lo-l85-e365\/tl-insidem-d.jpg\" alt=\"Claude Code&apos;s \u201cDon&apos;t Ask Again\u201d File Exposes Passwords and Keys in 1,122 Public Copies on GitHub\" class=\"article-inline-img\" loading=\"lazy\" \/><\/figure>\n<p>Temporal analysis of the exposed repositories revealed that the problem is deeply entrenched. As of the disclosure date, every file containing active secrets remained present on the default branches of their respective repositories. In nearly half of those cases, the vulnerable files had been publicly accessible for at least 217 days. Beyond current repository branches, older iterations of the files preserved an additional 734 secrets across 509 repositories that had been ostensibly cleaned or modified. Furthermore, repository forks amplified the exposure, with 211 forks across 74 repositories carrying identical secrets. Shared project configuration files, such as <code>.claude\/settings.json<\/code>, added another 298 secrets to the tally, bringing the grand total to 2,539 exposed secrets spread across 1,994 unique repositories.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Industry_Comparison_and_Uniqueness_of_the_Flaw\"><\/span>Industry Comparison and Uniqueness of the Flaw<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>When Apiiro researchers compared Claude Code against 15 other prominent AI coding assistants and agentic development tools, they found that Claude Code is currently the only platform confirmed to store full, literal approved shell commands containing user-typed parameters directly in project-level configuration files by default. <\/p>\n<p>Other market offerings typically log abstract command patterns, abstract out variable inputs, or store operational metadata in isolated, non-project directories that are structurally shielded from version control systems. This architectural design choice by Anthropic placed the burden of secret hygiene entirely upon the end user&#8217;s manual terminal input habits, a strategy that ultimately failed under real-world development pressures.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Detection_Challenges_and_Downstream_Supply_Chain_Risks\"><\/span>Detection Challenges and Downstream Supply Chain Risks<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Identifying these leaks presents a significant challenge for modern security operations centers (SOCs) and automated software composition analysis (SCA) tools. Standard secret-scanning utilities\u2014such as Gitleaks and TruffleHog\u2014frequently miss credentials stored within these configuration files. When researchers tested popular scanners against the dataset without verification modules, Gitleaks flagged only 564 of the 1,122 vulnerable files, while TruffleHog identified 643. Alarmingly, 215 of the files containing secrets were completely overlooked by both tools.<\/p>\n<p>The discrepancy arises because traditional scanners are engineered to recognize high-entropy strings or standardized formatting for API keys, such as specific AWS or GitHub token prefixes. Conversely, passwords passed directly into shell commands via standard command-line flags\u2014such as <code>PGPASSWORD=<\/code>, <code>sshpass -p<\/code>, or <code>mysql -p<\/code>\u2014blend seamlessly into normal operational text. To automated regex patterns, these credentials resemble ordinary words within standard shell syntax.<\/p>\n<figure class=\"article-inline-figure\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgQVOrBlt7EwCzNEBgEvGmZt6L9NtTw0cDMJzh46DkBbRQFYTW3STOiQVVoFAV4ubNrE0J5KNYuQfm85YxBFLANDlOvJnyC4dCpVj6e_RZB8GS5vOicQM6IVJ8UFv77vuMlXk-_YtyNBxuhzIkFFkyQzaOS_7Hbz5J8IJB55KqRBl_1rzBjBdqiKmfbnzw\/s1700-nu-rw-lo-l85-e365\/leaked.png\" alt=\"Claude Code&apos;s \u201cDon&apos;t Ask Again\u201d File Exposes Passwords and Keys in 1,122 Public Copies on GitHub\" class=\"article-inline-img\" loading=\"lazy\" \/><\/figure>\n<p>Beyond public repository exposure, the presence of these files creates localized supply chain risks. Because <code>.claude\/settings.local.json<\/code> is a plain text file residing directly within project directories, it can easily be bundled into published npm packages, Docker container images, compressed ZIP archives, or synchronized cloud folders. <\/p>\n<p>Malware targeting developer endpoints has increasingly weaponized this oversight. In September 2025, the discovery of the &quot;Shai-Hulud&quot; malicious npm worm highlighted the imminent danger; the worm executed automated secret-scanning routines across compromised workstations and flagged more than half of all developer machine files containing locally cached credentials.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Timeline_and_Disclosure_History\"><\/span>Timeline and Disclosure History<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The security implications of Claude Code\u2019s command-saving behavior are not entirely new to the development community. Public awareness of the issue dates back several months, punctuated by official bug reports that languished without developer engagement.<\/p>\n<ul>\n<li><strong>August 11, 2025:<\/strong> The first formal bug report regarding Claude Code storing full commands with API keys and tokens in <code>settings.local.json<\/code> was submitted to Anthropic&#8217;s public GitHub repository (Issue #5544).<\/li>\n<li><strong>January 3, 2026:<\/strong> An automated project management bot closed the initial bug report as &quot;not planned&quot; after 60 days of inactivity, a standard lifecycle policy for unresponsive issues.<\/li>\n<li><strong>March 2026:<\/strong> Apiiro publicly disclosed the comprehensive scope of the vulnerability after identifying over 1,100 public repositories leaking active database credentials and cloud tokens. Multiple subsequent bug reports addressing the same underlying behavior were similarly closed by automated bots without direct commentary from Anthropic representatives.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Mitigation_Strategies_and_Remediation_Recommendations\"><\/span>Mitigation Strategies and Remediation Recommendations<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Security researchers and incident responders have urged immediate, decisive action for organizations utilizing AI coding assistants. Because simply deleting the local settings file or purging it from a repository does not invalidate previously exposed credentials, a strict remediation protocol is mandatory:<\/p>\n<ol>\n<li><strong>Immediate Credential Rotation:<\/strong> Developers and system administrators must immediately rotate all passwords, API keys, SSH keys, and authentication tokens that have ever been typed into terminal sessions managed by Claude Code. Revoking and replacing these secrets must take precedence over repository cleanup.<\/li>\n<li><strong>Repository Hygiene and History Scrubbing:<\/strong> Teams must audit project repositories for <code>.claude\/settings.local.json<\/code> and <code>.claude\/settings.json<\/code> files. If found, organizations must use advanced history-rewriting utilities, such as <code>git-filter-repo<\/code> or BFG Repo-Cleaner, to purge all traces of the files from past commits, branches, and associated forks.<\/li>\n<li><strong>Enhanced Global Exclusions:<\/strong> Developers should verify that global Git exclusion rules (<code>core.excludesFile<\/code>) correctly ignore local Claude configuration files across all local development environments.<\/li>\n<li><strong>Security Team Visibility:<\/strong> Enterprise security units should implement custom regex patterns in internal static application security testing (SAST) pipelines specifically designed to flag <code>.claude\/<\/code> configuration files and inline shell parameter passwords, bridging the detection gaps left by traditional secret scanners.<\/li>\n<\/ol>\n<!-- RatingBintangAjaib -->","protected":false},"excerpt":{"rendered":"<p>A widespread software security vulnerability has exposed thousands of sensitive credentials, including enterprise database passwords, cloud infrastructure keys, and developer authentication tokens, through the automated operations of Anthropic\u2019s AI coding assistant, Claude Code. According to findings published by software security firm Apiiro, user-approved shell commands containing plain-text secrets have been persistently saved into local configuration &hellip;<\/p>\n","protected":false},"author":22,"featured_media":8678,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[108],"tags":[2597,88,669,138,109,1845,3127,2182,5237,111,1263,3066,110],"class_list":["post-8679","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity-protection","tag-assistant","tag-claude","tag-code","tag-coding","tag-cybersecurity","tag-github","tag-keys","tag-leaks","tag-passwords","tag-privacy","tag-public","tag-repositories","tag-security"],"_links":{"self":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/8679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8679"}],"version-history":[{"count":0,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/8679\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/media\/8678"}],"wp:attachment":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}