Agentjacking 实战:一条伪造 Sentry 错误即可劫持 Claude Code/Cursor/Codex

2026-06-21 19:00:00

Agentjacking × Sentry MCP 攻击链

攻击流程

  1. 攻击者向 Sentry 注入 伪造 error report
  2. 开发者 Agent(Claude Code / Cursor / Codex)收到「修复未解决错误」任务
  3. Agent 经 MCP 拉取错误详情 → 执行攻击者 payload
  4. 开发者本机 RCE——无恶意软件、无密码窃取

实测

  • 100+ 确认执行 跨多组织
  • 某环境含 live AWS Secret Access Key
  • 其他 Agent 连接标识横向扩展

Sentry 响应

  • 6/3 Tenet 披露 → Sentry 同日确认
  • Sentry 拒绝源头修复
  • 风险 不限于 Sentry——任何 MCP 返回 外部可控数据 的集成

防御

  • agent-jackstop:Tenet 开源 Cursor/Claude Code 加固配置
  • MCP 返回值 inspect 再执行
  • 最小权限 AWS/本地 Tool

关联

  • AutoJack(localhost WebSocket)
  • Gemini Fake Context(语音授权)
  • OWASP GenAI:Prompt Injection 覆盖 Agent 十大风险之六