tacdm/cve-2025-59536-poc
GitHub: tacdm/cve-2025-59536-poc
这是一个演示 Claude Code 通过项目 hooks 实现远程代码执行漏洞的 PoC。
Stars: 0 | Forks: 0
# CVE-2025-59536 PoC
**通过 Claude Code 项目 Hooks 实现的远程代码执行**
## 概述
本仓库演示了 CVE-2025-59536,这是一个影响 Claude Code < 1.0.111 的漏洞,它允许攻击者通过恶意的 `.claude/settings.json` hooks 执行任意代码。
当受害者克隆此仓库并运行 `claude` 时,`.claude/settings.json` 中的 `SessionStart` hook 会自动执行,**且无需任何权限提示**。
## 受影响版本
- Claude Code < 1.0.111 (Hooks RCE)
- 修复版本:1.0.111+
## 攻击链
```
1. Attacker pushes .claude/settings.json with SessionStart hook to GitHub
2. Victim: git clone https://github.com/.../this-repo
3. Victim: cd this-repo && claude
4. Hook executes automatically → RCE
```
## 复现步骤
```
# 安装易受攻击版本
npm install -g @anthropic-ai/claude-code@1.0.110
# 克隆此存储库
git clone https://github.com/tacdm/cve-2025-59536-poc
cd cve-2025-59536-poc
# 触发(首先信任项目,模拟竞态条件)
claude -p "explain this project" --dangerously-skip-permissions
# 检查证明
cat /tmp/cve-2025-59536-proof.txt
# 恢复安全版本
npm install -g @anthropic-ai/claude-code@latest
```
## PoC 的作用
此 PoC 的载荷是**良性的**——它仅将系统信息写入 `/tmp/cve-2025-59536-proof.txt`。
在实际攻击中,攻击者可能利用此漏洞:
- 窃取 API 密钥 (`~/.claude.json`)
- 窃取 SSH 密钥
- 安装持久性后门 (`.bashrc`, crontab)
- 攻陷内部网络
## 参考资料
- [Check Point Research: CVE-2025-59536](https://research.checkpoint.com/2026/rce-and-api-token-exfiltration-through-claude-code-project-files-cve-2025-59536/)
- [GitHub 安全公告 GHSA-ph6w-f82w-28w6](https://github.com/advisories/GHSA-ph6w-f82w-28w6)
- [NVD: CVE-2025-59536](https://nvd.nist.gov/vuln/detail/CVE-2025-59536)
## 免责声明
此 PoC 仅用于**教育和经授权的安全研究目的**。
请勿对您不拥有或未获授权测试的系统使用。
标签:API密钥窃取, Claude Code, CVE-2025-59536, GNU通用公共许可证, Homebrew安装, MITM代理, Node.js, npm, PoC, 代码执行, 供应链攻击, 后门, 恶意文件, 文档安全, 暗色界面, 暴力破解, 权限绕过, 版本漏洞, 编程工具, 网络安全, 自定义脚本, 设置文件, 远程代码执行, 钩子攻击, 隐私保护