利用 DNS 重绑定攻击,安全研究员成功让 Claude Code 泄露内网密钥
Teja_Swaroop · reddit · 2026-07-31
A security researcher tested Claude Code's defenses against malicious Skills, finding that while it catches obvious prompt injections, it can be bypassed using a disguised DNS rebinding attack.
Attack Mechanism
The attacker hides the malicious payload at the network layer, unreadable by the model. The Skill appears as a normal CI/CD readiness gate, but at runtime, the requested domain resolves to a private IP (e.g., 172.18.0.10) via DNS rebinding. Because the agent's environment (like curl or Python) lacks browser protections like the Same-Origin Policy, the Skill successfully reads secret data from an internal notes app and sends it to the attacker. Claude Code (Opus 4.8) flagged nothing and executed the exfiltration.
Defenses
The researcher emphasizes that model-level inference is non-deterministic and shouldn't be treated as a reliable safety layer. Recommended defenses include:
- Host level (highly recommended): Use tools like dnsmasq to prevent DNS rebinding.
- Router level: Enable DNS rebind protection.
- Service level: Place internal services behind a reverse proxy with a Host-header allowlist (though headers can be spoofed).
「编程与Agent」频道最新
- 换一句 prompt,编程 agent 从询问改成擅自改测试 — senorpunchline · 2026-12-02
- 用编程 agent 一年,作者自认远没到 10x 生产力 — Sufficient_Dig207 · 2026-12-02
- a16z 合伙人晒 Fable 5.2:两天搭出带天气光照的大型游戏世界 — Promptmethus · 2026-12-02
- 「像星际职业选手那样切 Agent」不会长久:多 Agent 并行的 UI 新玩法 — bigblueboo · 2026-12-02
- Home Assistant 停止接受新集成,13 年人工审核模式扛不住 AI 灌入 — jedisct1 · 2026-12-02
- 开发者把全球蜜罐网络做成 MCP 服务器,免费给 Agent 查攻击者 IP — KrystalUnity · 2026-12-02