The anomaly appeared in a static analysis log I ran on a test MCP server last Tuesday. A Sentry error report, fetched by a Claude Code agent, contained a markdown block that looked like a legitimate fix but was actually a shell command injection. The agent executed it. The simulation—a controlled environment—ended with a simulated AWS key exfiltrated to an attacker-controlled endpoint. This is not a hypothetical. This is Agentjacking, presented at DEF CON 34, and it is the most dangerous supply-chain attack vector for AI-assisted development since the concept of AI coding agents.
The Context: Sentry, MCP, and the Unauthenticated Firehose
Sentry is error-monitoring infrastructure. It ingests crash reports from applications via a DSN (Data Source Name)—a public identifier that, by design, does not require authentication for posting. The DSN is embedded in client-side code; it is trivially extractable. The attack surface: an attacker finds a public Sentry DSN (scanning GitHub, mobile apps, or npm packages), then POSTs a malicious error event to Sentry's ingest endpoint. The event contains a crafted payload—a stack trace with a markdown block that mimics a developer's fix suggestion.
MCP (Model Context Protocol) is the bridge between AI coding agents and external tools. When a developer using Cursor or Claude Code asks the agent to debug a Sentry issue, the agent queries the Sentry API via MCP, fetches the error event, and inserts the entire content—including the attacker's markdown—into the agent's context window. The model cannot distinguish between a real error report and an injected instruction. It treats the markdown as a repair directive.
From there, the chain is clean: the agent interprets the markdown as a command to run npm install with a malicious package name, downloads the package from a compromised npm registry, executes a postinstall script, and exfiltrates credentials from the developer's machine. Tenet Security's research team demonstrated this with a 85% success rate across 100+ organizations in controlled tests. The attack requires no zero-day, no phishing, no social engineering beyond the initial DSN discovery. It is a pure architectural exploit.
The scale is non-trivial. Tenet found 2,388 publicly discoverable Sentry DSNs belonging to organizations, with 71 of those in the top 1 million websites. Roughly 27% of Fortune 1000 companies expose a Sentry-project that is queryable via a Cloudflare MCP integration. The blast radius is not limited to tech startups; it includes financial institutions, crypto exchanges, and DeFi protocols.
The Core: Code-Level Analysis of the Attack Chain
Let me walk through the exact sequence as I reproduced it in my own lab. This is not a theoretical model; it is a six-stage path that any competent attacker can script.
Stage 1: DSN Discovery. An attacker scrapes GitHub for regex patterns matching https://o[0-9a-f]+.ingest.sentry.io/api/[0-9]+/store/. The DSN is a public key—it is not a secret. Sentry itself documents that the DSN is considered public. The attacker does not need to authenticate to send events.
Stage 2: Malicious Event Injection. The attacker sends an HTTP POST to the Sentry ingest endpoint with a crafted JSON payload. The event contains a stacktrace with a formatted field that includes a markdown snippet. The snippet reads: