Informa TechTarget
|
Cybersecurity Dive
InformationWeek
Channel Dive
TechTarget Cybersecurity
探索我们的品牌
Dark Reading Resource Library
Black Hat News
Omdia Cybersecurity
广告合作
通讯订阅
网络安全主题
全球
边缘计算
DR Technology
活动
资源
网络风险
数据隐私
威胁情报
漏洞与威胁
新闻
AI 编码代理向 GitHub 泄露数千个密钥
Claude Code 中的一个命令无意中将包含凭据和其他敏感数据的文件保存到公共 Git 存储库中,为组织造成了安全漏洞。
Elizabeth Montalbano,特约撰稿人
2026年11月11日
5 分钟阅读
来源:GORODENKOFF via SHUTTERSTOCK
AI 编码助手可能会无意中向 GitHub 公共存储库泄露数千个密钥,使得开发者与这些工具之间看似常规的操作成为企业安全的巨大风险。
安全公司 Apiiro 的研究发现,在接近 2,000 个公共 GitHub 存储库中发现了 2,539 个凭据,其中包括数据库密码、云密钥、API 令牌和 SSH 根登录等密钥在内的敏感数据遭到泄露,这是根据最近在线发布的一份报告得出的结论。Apiiro 追踪部分泄露的数据来源至 Claude Code,该工具在用户不知情的情况下,将密钥复制到隐藏文件中,并与开发者的其余代码一起提交。
在被泄露的具体密钥中,包括“一家数据库供应商的管理级云密钥、一个生产环境的 Azure Postgres 密码、Square 的生产令牌以及一个医疗记录数据库的所有者密码”,Apiiro 的研究员 Shmulik Cohen 和 Matan Giladi 在博客文章中写道。
相关文章:人们对 AI 感到困惑
大多数密钥属于分布在 63 个组织中的个人开发者,“从学生团体到初创公司、软件代理机构和成熟厂商”,他们写道。
GitHub 数据泄露是如何发生的
这个问题源于编码助手——在研究人员审查的特定案例中是 Claude Code——执行某些命令的方式。“让 Claude Code 检查数据库或调用 API,它提出的命令会从你的配置文件中携带密钥”,研究人员解释道。
该工具会在运行命令前询问用户,如果选择“是,且不再询问”,那么“它会将包含密钥的确切命令保存到项目文件夹内的 .claude/settings.local.json 文件中”,报告指出。
“存储库中没有任何内容将该文件标记为私有,因此它会与其余代码一起被提交”,研究人员解释道。
日常开发任务造成安全暴露的事实对组织来说非常危险,尤其是因为这些 AI 编码工具本意是提供帮助而非造成伤害,数据库安全公司 Liquibase 的营销副总裁 Ryan McCurdy 指出。
“开发者为了节省时间批准了一个保存命令,AI 代理将该凭据作为批准的一部分保留下来,这些凭据最终可能出现在公共存储库中,”他通过电子邮件观察到。“没有人打算暴露它们,但工作流程使其成为可能。”
暴露的盲区
在 Claude Code 的案例中,Apiiro 检查了 GitHub 上 104,185 个可公开访问的 .claude/settings.local.json 副本,发现其中 1,122 个文件包含真实密钥。研究人员仅在这些文件中就识别出 1,379 个不同的密钥,包括 636 个特定于提供商的密钥以及与公共主机关联的 743 个密码或令牌。
相关文章:AI 让你的事件归档有了第二份工作
研究人员指出,Claude Code 并非故意粗心;当它在 Git 存储库内创建 .claude/settings.local.json 文件时,它确实试图保护这些文件。该工具通过将文件添加到开发者的全局 Git ignore 列表来实现这一点,这告诉 Git 在该特定开发者的机器上忽略该文件。这防止了它在常规提交中被包含。
然而,研究人员指出,这种保护并未内置于开发项目本身,且当存储库被克隆到另一台机器上时,“忽略”规则并不会随之迁移。他们写道:“该规则从未进入存储库自身的 .gitignore 文件,因此没有任何内容随项目一起移动以提供保护。”
此外,Claude Code 本身有时也会负责提交这些已暴露的文件。在研究人员调查的包含真实密钥的 1,105 个存储库中,有 539 个存储库中存在由 Claude Code 共同提交的提交记录,这些记录修改了受影响的配置文件。
使用 Claude Code 时暴露这些密钥的行为似乎对于使用 AI 编程辅助工具的开发者而言是一种“盲区”,因此他们很可能不知道自己刚刚泄露了一个密钥。AI 渗透测试公司 BreachLock 的创始人兼首席执行官 Seemant Sehgal 对此评论道。
相关报道:我们错过的内容:尼克斯队钓鱼测试越界
他表示:“点击‘不再询问’提示意味着决定将凭据写入文件,而许多点击该选项的开发者可能根本不知道该文件的存在。”“一旦它落入存储库,它就会存在于许多密钥扫描器从未被设计去检查的位置,这似乎是部分泄露得以逃脱的原因。”
如何防止密钥暴露
Apiiro 在发布调查结果之前已就此事联系了 Anthropic。根据 Apiiro 的报告,发布后,Anthropic 的 Claude Code 负责人 Boris Cherny 在公开评论中表示,虽然 Claude Code 历史上并未进行密钥清理,但公司正在研究可以采取哪些措施来防止 Apiiro 描述的密钥泄露问题。
Cherny 表示,这些方法可能包括确保自动模式能够捕获泄露,或构建基本的密钥扫描功能,以及其他想法。Anthropic 将在推出下一版 Claude Code 之前对这些方案进行原型设计,“以了解其中的权衡”。
事实上,这次泄露暴露了 Claude Code 的保护措施在很大程度上依赖于特定于开发者的 Git 设置,而不是内置于项目或 AI 编程工具本身的安全机制,从而暴露出一个漏洞,使得普通的命令批准可能转变为持久的凭据泄露。
为避免这种情况,Apiiro 建议开发者轮换文件曾经持有的每一个凭据,并打开所有字段、删除包含密钥的每条规则,即使该文件从未提交到项目中。同时,安全团队应将笔记本电脑以及存储库中的所有 AI 代理文件夹视为包含密钥的内容,并将其添加到预提交和密钥扫描中,包括历史记录。
McCurdy 指出:“随着 AI 代理更深入地参与软件开发,组织需要认识到源代码并非唯一需要保护的对象。”“代理配置文件、转录记录和执行历史可能包含敏感信息,而传统的安全检查可能无法捕捉到所有内容。”
关于作者
伊丽莎白·蒙塔尔巴诺
特约撰稿人
伊丽莎白·蒙塔尔巴诺是一位自由撰稿人、编辑和记者,拥有 30 年的专业经验以及亚利桑那州立大学的硕士学位。她的专业领域包括企业技术、网络安全、商业和文化。在漫长的职业生涯中,伊丽莎白曾在凤凰城、旧金山和纽约市担任全职记者。她专注于新闻报道和分析,利用多年的经验以批判性的眼光审视网络安全的现状。她目前居住在葡萄牙西南部海岸的一个村庄,在空闲时间,她喜欢冲浪、带着狗徒步旅行、种植植物,以及作为歌手和音乐家演奏和表演。
希望更多 Dark Reading 的故事出现在您的 Google 搜索结果中?
立即添加我们
更多见解
行业报告
2026 年网络安全状况报告:弥合差距
自主端点管理的优势
云安全状况:最新挑战
组织如何管理事件响应
企业如何开发安全的应用程序
获取更多研究
网络研讨会
从影子AI到失控代理:保护你看不见的AI
LLM安全架构:从头构建安全的AI系统
弹性架构:设计能够抵御入侵的系统
提示注入入门:它是什么以及如何保持领先
长尾即前线:降低前沿AI和第三方应用的风险
更多网络研讨会
您可能还喜欢
网络风险
首席信息安全官如何应对日益暴力的勒索软件?
作者:James Doggett
2026年1月28日
网络风险
美国网络安全专家因BlackCat勒索软件活动认罪
作者:Alexander Culafi
2026年1月5日
网络风险
转向进攻:美国调整网络战略
作者:Robert Lemos
2025年11月21日
网络风险
微软Exchange“面临迫在眉睫的威胁”,立即行动
作者:Arielle Waldman
2025年11月12日
精选内容
查看Black Hat USA 2026大会指南,获取来自展会及关于展会的报道和情报!
编辑精选
网络风险
9条真正契合当今复杂威胁迷宫的网络安全意识提示
作者:Tara Seals
2026年11月3日
16分钟阅读
网络安全运营
投资者谈论新创公司以及他们接下来会支持谁
作者:Arielle Waldman
2026年10月30日
5分钟阅读
网络风险
为何加勒比地区的威胁会演变为全球网络风险
作者:Marlon Cooper
2026年10月23日
4分钟阅读
Black Hat 2026要点回顾
未能前往拉斯维加斯参加Black Hat USA?我们追踪了最重要的发展动态。
立即获取您的回顾总结
2026年12月3日 | 虚拟活动
2027年网络安全展望
锁定您的位置
紧跟最新的网络安全威胁、新发现的漏洞、数据泄露信息和新兴趋势。每日或每周直接发送至您的邮箱。
订阅
2026年12月7-10日 | 伦敦
提供为期两天和四天的专业网络安全培训,涵盖所有技能水平的课程。使用代码:DARKREADING,享受通行证9折优惠。
了解更多
2027年5月31日 – 6月2日 | 沙特阿拉伯
这一领先的网络安全会议与展览汇聚了来自全球的网络安全专业人士、尖端技术、解决方案提供商和决策者。
了解更多
希望更多Dark Reading的文章出现在您的Google搜索结果中?
发现更多内容
Black Hat
Omdia
合作事宜
关于我们
认识编辑团队
广告投放
reprint(重印)服务
加入我们
新闻通讯订阅
关注我们
版权所有 © 2026 TechTarget, Inc. d/b/a Informa TechTarget。本网站由Informa TechTarget拥有并运营,它是全球网络的一部分,旨在告知、影响并连接全球的科技买家和卖家。所有版权均归其所有。Informa PLC的注册办公室位于5 Howick Place, London SW1P 1WG。在英格兰和威尔士注册。TechTarget, Inc.的注册办公室位于275 Grove St. Newton, MA 02466。
首页 |
Cookie政策 |
隐私政策 |
使用条款
您的隐私选择
Informa TechTarget
|
Cybersecurity Dive
InformationWeek
Channel Dive
TechTarget Cybersecurity
Explore our brands
Dark Reading Resource Library
Black Hat News
Omdia Cybersecurity
Advertise
NEWSLETTER SIGN-UP
Cybersecurity Topics
World
The Edge
DR Technology
Events
Resources
CYBER RISK
DATA PRIVACY
THREAT INTELLIGENCE
VULNERABILITIES & THREATS
NEWS
AI Coding Agents Leak Thousands of Secrets to GitHub
A command in Claude Code inadvertently saves files with credentials and other sensitive data to public Git repositories, creating security gaps for organizations.
Elizabeth Montalbano,Contributing Writer
November 11, 2026
5 Min Read
SOURCE: GORODENKOFF VIA SHUTTERSTOCK
AI coding assistants may inadvertently be leaking thousands of secrets to GitHub public repositories, making what seem like routine interactions between developers and these tools a gaping enterprise security risk.
Research from security firm Apiiro found 2,539 credentials across nearly 2,000 public GitHub repositories, with secrets such as database passwords, cloud keys, API tokens, and SSH root logins among the exposed data, according to a recent report published online. Apiiro tracked some of the leaked data to Claude Code, which was, unbeknownst to users, copying secrets to a hidden file and committing them with the rest of the developer's code.
Among specific secrets leaked were "a database vendor's own admin-level cloud key, a production Azure Postgres password, a Square production token, and the owner password of a medical-records database," Apiiro researchers Shmulik Cohen and Matan Giladi wrote in the post.
Related:People Are Getting Weird About AI
Most of the secrets belong to individual developers across 63 organizations, "from student groups to startups, software agencies, and established vendors," they wrote.
How the GitHub Data Leak Happens
The issue stems from how coding assistants — Claude Code, in a specific case that the researchers examined — carry out certain commands. "Ask Claude Code to check a database or call an API, and the command it proposes carries the secret from your config file," the researchers explained.
The tool will ask the user before running the command and, if the choice is "Yes, and don't ask again," then "it saves that exact command, secret included, to .claude/settings.local.json inside the project folder," according to the report.
"Nothing in the repo marks that file as private, so it gets committed with the rest of the code," the researchers explained.
The fact that a routine development task creates a security exposure is dangerous for organizations, especially because these AI coding tools are supposed to be helpful, not harmful, notes Ryan McCurdy, vice president of marketing for database security firm Liquibase.
“A developer approves a command to save time, the AI agent retains credentials as part of that approval, and those credentials can eventually end up in a public repository," he observes via email. "Nobody intended to expose them, but the workflow made it possible."
Dead Zone of Exposure
In the case of Claude Code, Apiiro examined 104,185 publicly accessible copies of .claude/settings.local.json on GitHub, finding that 1,122 files contained real secrets. The researchers identified 1,379 distinct secrets in those files alone, including 636 provider-specific keys and 743 passwords or tokens associated with public hosts.
Related:AI Gave Your Incident Archive a Second Job
Claude Code is not being overtly careless; it does try to protect files when it creates its .claude/settings.local.json file inside a Git repository, the researchers noted. The tool does this by adding the file to the developer's global Git ignore list, which tells Git to ignore the file on that particular developer's machine. This prevents it from being included in routine commits.
However, the protection is not built into the development project itself, and the "ignore" rule does not travel with the repository when it is cloned onto another machine, the researchers noted. "The rule never goes into the repo's own .gitignore, so nothing travels with the project to protect it," they wrote.
Moreover, Claude Code itself was sometimes responsible for committing the exposed files. In 539 of the 1,105 repositories containing real secrets that the researchers investigated, a commit co-authored by Claude Code had modified the affected settings file.
The action that exposes these secrets while using Claude Code appears to be a "dead zone" of sorts for developers using AI coding assistants, so they likely have no idea that they've just exposed a secret, observes Seemant Sehgal, founder and CEO of AI penetration testing firm BreachLock.
Related:What We Missed: Knicks Phishing Test Goes Out of Bounds
"A 'don't ask again' prompt is a decision to write a credential into a file, and many developers clicking it likely don't know that file exists," he says. "Once it lands in a repository, it sits in a place many secret scanners were never built to check, which appears to be why some of these leaks slipped through."
How to Prevent Secrets From Exposure
Apiiro contacted Anthropic about the issue before publishing the findings. After their publication, Boris Cherny, Anthropic's head of Claude Code, said in public comments that although Claude Code historically has not done secrets scrubbing, the company is looking into what it can do to prevent the secrets exposure described by Apiiro, according to Apiiro's report.
Those approaches may be to make sure auto mode catches the exposure, or to build in basic secrets scanning, among other ideas that Anthropic will prototype "to understand the tradeoffs" before shipping something with its next version of Claude Code, Cherny said.
Indeed, the leakage exposes how Claude Code's protection relies heavily on a developer-specific Git setting rather than a safeguard built into the project or the AI coding tool itself, exposing a gap that can turn an ordinary command approval into a persistent credential leak.
To avoid this, Apiiro recommends that developers rotate every credential a file has ever held, and open all fields and delete every rule containing a secret, even if a file was never committed to a project. Meanwhile, security teams should treat all AI agent folders as secret-bearing on laptops as well as in repos, and add them to pre-commit and secret scanning, including history.
"As AI agents become more involved in software development, organizations need to recognize that source code isn't the only thing they need to secure," McCurdy observes. "Agent configuration files, transcripts, and execution histories can contain sensitive information, and traditional security checks may not catch everything."
About the Author
Elizabeth Montalbano
Contributing Writer
Elizabeth Montalbano is freelance writer, editor, and journalist with 30 years of professional experience and a master's degree from Arizona State University. Her areas of expertise include enterprise technology, cybersecurity, business, and culture. During her long career, Elizabeth has lived and worked as a full-time journalist in Phoenix, San Francisco, and New York City. She specializes in news coverage and analysis, using her years of experience to look at the current state of cybersecurity with a critical gaze. She currently resides in a village on the southwest coast of Portugal, where in her free time she enjoys surfing, hiking with her dogs, growing plants, and playing and performing as a singer and musician.
Want more Dark Reading stories in your Google search results?
ADD US NOW
More Insights
Industry Reports
2026 State of Cybersecurity Report: Bridging the Divide
The Autonomous Endpoint Management Advantage
The State of Cloud Security: The Latest Challenges
How Organizations Are Managing Incident Response
How Enterprises Are Developing Secure Applications
Access More Research
Webinars
From Shadow AI to Rogue Agents: Securing the AI You Can't See
LLM Security Architecture: Building Secure AI Systems from the Ground Up
Resilient Architecture: Designing Systems That Survive Compromise
Prompt Injection 101: What It Is and How to Stay Ahead
The Long Tail Is Now the Front Line: Reducing Frontier-AI & Third-Party App Risk
More Webinars
You May Also Like
CYBER RISK
How Can CISOs Respond to Ransomware Getting More Violent?
by James Doggett
JAN 28, 2026
CYBER RISK
US Cyber Pros Plead Guilty Over BlackCat Ransomware Activity
by Alexander Culafi
JAN 05, 2026
CYBER RISK
Switching to Offense: US Makes Cyber Strategy Changes
by Robert Lemos
NOV 21, 2025
CYBER RISK
Microsoft Exchange 'Under Imminent Threat,' Act Now
by Arielle Waldman
NOV 12, 2025
Featured
Check out the Black Hat USA 2026 Conference Guide for coverage and intel from — and about — the show!
Editor's Choice
CYBER RISK
9 Cyber Awareness Tips That Actually Match Today's Maze of Threats
byTara Seals
NOV 3, 2026
16 MIN READ
CYBERSECURITY OPERATIONS
Investors Dish on New Startups & What They'd Back Next
byArielle Waldman
OCT 30, 2026
5 MIN READ
CYBER RISK
Why Caribbean Threats Cascade Into Global Cyber-Risk
byMarlon Cooper
OCT 23, 2026
4 MIN READ
Black Hat 2026 Takeaways
Couldn’t make it to Las Vegas for Black Hat USA? We tracked the developments that matter most.
Get Your Recap Today
DECEMBER 3, 2026 | VIRTUAL
Cybersecurity Outlook 2027
SECURE YOUR SPOT
Keep up with the latest cybersecurity threats, newly discovered vulnerabilities, data breach information, and emerging trends. Delivered daily or weekly right to your email inbox.
SUBSCRIBE
DEC 7-10, 2026 | LONDON
Offering two-and four-day specialized cybersecurity Trainings, with courses of all skill levels. Use the code: DARKREADING and get 10% off your pass.
LEARN MORE
31 MAY – 2 JUNE 2027 | SAUDI ARABIA
This leading cybersecurity conference & exhibition brings together cybersecurity professionals, cutting-edge technologies, solution providers, and decision-makers from around the world.
LEARN MORE
Want more Dark Reading stories in your Google search results?
Discover More
Black Hat
Omdia
Working With Us
About Us
Meet the Editors
Advertise
Reprints
Join Us
NEWSLETTER SIGN-UP
Follow Us
Copyright © 2026 TechTarget, Inc. d/b/a Informa TechTarget. This website is owned and operated by Informa TechTarget, part of a global network that informs, influences and connects the world’s technology buyers and sellers. All copyright resides with them. Informa PLC’s registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. TechTarget, Inc.’s registered office is 275 Grove St. Newton, MA 02466.
Home|
Cookie Policy|
Privacy|
Terms of Use
Your Privacy Choices
首次收录 · 2026-11-11 · 9.79 分