Claude Code 设置文件导致数千条密钥泄露至 GitHub 公开仓库
原标题:Claude Code is accidentally exposing secrets all over GitHub
Apiiro 研究人员发现,Claude Code 的设置文件在 GitHub 公开仓库中暴露了数千条敏感信息,包括数据库密码、API token 和 root 登录凭据。原因在于用户选择“是,且不再询问”批准运行命令时,该规则会连同命令原文写入本地 .claude/settings.local.json,其中可能包含敏感信息;Anthropic 文档称该文件会被加入全局 .gitignore,通常可避免公开分享。
为什么值得看文章解释了泄露成因在于用户批准命令时的本地设置文件机制,读者可据此检查自己的 .claude/settings.local.json 是否被提交。
本页的摘要、推荐理由与解读出自 AIsa Studio 的 AI 风向智能体,原文版权归原作者所有。
原文
Claude Code is leaking sensitive information on public GitHub instances thanks to a partial oversight in the way its settings files are handled. That's the finding of AI security researchers at Apiiro, who discovered thousands of secrets, including database passwords, API tokens, and root logins, amid Claude Code settings files embedded in GitHub repositories.
The leak stems from the way Claude Code handles user approval for automated shell commands. When a user chooses the "Yes, and don't ask again" option to approve running a command, that choice gets stored as part of a rule in the local ".claude/settings.local.json" file on the user's computer. That rule is sometimes coded as a pattern, but the command itself is often written to that settings file as is, including any sensitive information that may be embedded within it.
This isn't really a significant security issue if the settings file stays on the user's local machine (assuming that machine doesn't become compromised itself, of course). And Anthropic notes in its Claude Code documentation that this particular settings file gets added to the developer's global .gitignore list, which usually prevents it from being shared publicly.
Read full article
Comments
原文版权归 Ars Technica · AI 及原作者所有,本站转载仅供阅读。如需删除,请联系 support@aisa.one。