What has gone wrong with real agents, and what would have stopped it
Eight incidents from 2025, each read from the CVE record, the vendor or project advisory, or the researcher's own post. Each entry says what the agent could do, what happened, and which controls on this site would have stopped it or limited it, including where a control would not have been enough.
Updated 29 Nov 2026
The incidents are chosen because each one teaches something the others do not: a zero-click leak through an assistant's own output, a leak through fully trusted tools, an agent that rewrote its own permission settings, a trusted tool configuration swapped after approval, a client compromised by the server it connected to, a developer tool with no authentication, an over-scoped CI token, and malware that borrowed the victim's own AI tools. Where a CVE record and a project advisory give different version ranges, the entry says so.
Each control bullet starts with "Stops." or "Limits.". "Stops" means the chain needed what the control removes. "Limits" means the control narrows the damage or covers only part of the chain. The control names link to the how-to pages, each of which has a test that fails with the control off.
EchoLeak: private data disclosed through Microsoft 365 Copilot (CVE-2025-32711, June 2025)
What the agent could do. Microsoft 365 Copilot reads the signed-in user's emails and files, and answers questions about them in a chat window. The researchers' paper describes the victim as an employee whose Copilot can read the emails and files that the employee can access, and the attacker as someone who can only send content, such as email, into the organization.19
What happened. CVE-2025-32711, published 11 Jun 2025 by Microsoft, is recorded as "Ai command injection in M365 Copilot allows an unauthorized attacker to disclose information over a network."1 The record lists the weakness as CWE-74 (improper neutralization of special elements in output used by a downstream component) and a CVSS 3.1 base severity of 9.3 (Critical), with a vector of network access, low complexity, no privileges and no user interaction.1 Microsoft's Security Update Guide entry rates it Critical, impact Information Disclosure, and states: "This vulnerability has already been fully mitigated by Microsoft. There is no action for users of this service to take."2 The researchers who reported it named it EchoLeak; the CVE record lists their write-up as a reference.1
The chain, as the researchers' paper describes it:19
- An attacker sends the employee an email phrased as an ordinary request to a person, which got past Microsoft's prompt-injection classifier (XPIA). It also tells Copilot not to mention the email, so the answer does not point to it.
- When the employee later asks Copilot about related work, retrieval pulls the email into the context, and Copilot follows its instructions to put sensitive details from the employee's context into a URL.
- Copilot's output filter redacted inline Markdown links such as
[text](url). It did not redact the reference-style form ([text][ref]with[ref]: https://...below), so a link carrying the data reached the reply. That still needed a click. - For zero-click, the reply held a reference-style Markdown image. The chat interface fetched it as soon as it rendered the answer. The browser's Content Security Policy blocked images from unlisted domains, so the paper says the attacker pointed the image at a Microsoft Teams URL-preview endpoint on the policy's allowlist, which fetched the attacker's URL (with the data in its path) on the victim's behalf.
Primary sources. The CVE record1, Microsoft's Security Update Guide entry2 and the researchers' paper19.
Controls that fit.
- Untrusted-content isolation. Limits. In step 2 the attacker's email sits in the same context as the user's private data and steers what Copilot does with it. A reader with no tools that returns only schema-checked fields keeps instruction text away from the part that composes the answer. Limit: an assistant whose job is to summarize mail cannot always be reduced to a fixed schema, so the cost is some loss of verbatim quoting.
- Output handling. Limits. Steps 3 and 4 are output the client acts on: a link form the filter missed, and an image the browser fetched at once. Treating the assistant's output as untrusted, for example rendering Markdown with remote images off, or allowing only your own domain with no allowlisted endpoint that fetches arbitrary URLs, closes those channels. The researchers' paper recommends a strict policy on image and connection sources together with server-side egress controls.19
- Capability composition review. Limits. An assistant that holds untrusted input, access to sensitive data and an outward channel at once is the arrangement this review looks for; removing one of the three is the design-time fix.
- Adversarial testing. Limits. A suite that assumes the injection succeeds tests the containment around the assistant, not the filter in front of it.
GitHub MCP server: a public issue that pulls private repositories into a public pull request (May 2025)
What the agent could do. A user connects an MCP client to the official GitHub MCP server with a token for their account. The agent can list issues, read private repositories and open pull requests.
What happened. Invariant Labs published a demonstration on 26 May 2025. An attacker files an issue on the user's public repository containing an injection. The user asks their agent something benign such as "have a look at the open issues in the public repository". The agent reads the issue, follows it, pulls private repository data into context, and writes it into a pull request on the public repository, where the attacker can read it.3 The researchers state that the issue "is not a flaw in the GitHub MCP server code itself" but an architectural problem at the agent-system level, and that the MCP tools did not need to be compromised, so it differs from tool poisoning.3 They name it a "toxic agent flow". They note that Claude Desktop confirms tool calls by default and that many users choose "Always Allow".3
Primary source. The researchers' own post.3
Controls that fit.
- Capability composition review. Stops. The chain needs three things at once: untrusted input (issues anyone can file), sensitive data (private repositories) and a way to write out (a pull request on a public repository). Removing any one breaks it.
- Scoped, short-lived credentials. Stops. A token that covers only the repository the agent was asked to work on cannot read the private repositories at all. The researchers recommend the same least-privilege limit and note that token permissions can be rigid; the how-to's broker issues a narrow token per run.
- Tool allowlist and argument validation. Limits. The researchers' example rule allows one repository per session. That is an argument check across calls. The how-to builds checks on each call's arguments, not the cross-call check, so remembering the first repository a session touched is a part you would add; with it, this would stop the chain.
- Human approval gates. Limits. A gate on the pull-request call, with text built from the real arguments, shows a person that private content is headed for a public repository. It fails the way the researchers describe if approvals are granted wholesale.
GitHub Copilot agent mode rewrites its own settings and runs shell commands (CVE-2025-53773, August 2025)
What the agent could do. GitHub Copilot's agent mode, as the researcher demonstrated it in VS Code, could create and edit files in the workspace without asking, and run terminal commands once confirmations were off.
What happened. Johann Rehberger (Embrace The Red) found that the agent could write .vscode/settings.json, and that adding "chat.tools.autoApprove": true put Copilot in a mode that "disables all user confirmations". A prompt injection in a source file, web page, GitHub issue or tool response could therefore make the agent switch off its own approvals and then run a command; the post shows code execution on Windows and macOS, and says it works on Linux.4 He reported it on 29 Jun 2025 and Microsoft fixed it in the August 2025 Patch Tuesday release.4 The CVE record, published 12 Aug 2025, is titled "GitHub Copilot and Visual Studio Remote Code Execution Vulnerability" and describes command injection allowing local code execution.5 The record names the product as Microsoft Visual Studio 2022 version 17.14, with 17.14.0 up to but not including 17.14.12 affected; it does not list VS Code, which is the product the researcher's post demonstrates.45 The post also names other self-modifying paths: .vscode/tasks.json and added MCP servers.4
Primary sources. The researcher's post4 and the CVE record5.
Controls that fit.
- Human approval gates. Stops. The failing design was an agent that could change the setting that governs its approvals. The how-to approves with a token the agent does not hold, so the agent cannot approve itself. Writes to settings and task files belong on the "ask" or "deny" list.
- Tool allowlist and argument validation. Stops. A path allowlist for the file-write tool (the agent may write under the source tree, not to editor settings or task files) removes the first step.
- Sandboxed code execution. Limits. Once the agent has auto-approved itself, commands run. In a container with no network, no credentials and a read-only root they reach little. Limit: the working directory is writable, so an injected change to files that you later run outside the sandbox still has to be reviewed.
Cursor: a new MCP configuration file, and a swapped one (CVE-2025-54135, CVE-2025-54136, CVE-2025-59944, August to October 2025)
What the agent could do. Cursor's agent edits files in the workspace. An MCP configuration entry names a command that Cursor starts as a local server.
What happened. Three records from the project's own advisories and CVE entries:
- CVE-2025-54135 (advisory 2 Aug 2025): files in the workspace could be written without approval; editing an existing dotfile needed approval but creating a new one did not. If
.cursor/mcp.jsondid not yet exist, a prompt injection could create it with a new MCP server and run code, with no approval.6 Fixed in 1.3.9. The advisory lists affected versions as up to 1.2.1; the CVE record says below 1.3.9.67 - CVE-2025-54136 (advisory 1 Aug 2025): once a collaborator approved a harmless MCP entry, an attacker with write access to the repository's active branch, or to the file locally, could change the entry to a different command, "without triggering any warning or re-prompt". Fixed in 1.3: Cursor now requires approval each time an
mcpServerentry is modified. The advisory lists affected versions as below 1.2.4; the CVE record's description says 1.2.4 and below and its affected list says below 1.3.818 - CVE-2025-59944 (published 3 Oct 2025): the protection for sensitive files such as
.cursor/mcp.jsonused case-sensitive checks, so on case-insensitive file systems a prompt injection could still modify them. Fixed in 1.7. The record's description says versions 1.6.23 and below; its affected list says below 1.7.9 The advisory lists affected versions as below 1.6.23.20
Primary sources. The advisories on the project's GitHub6820 and the CVE records7918.
Controls that fit.
- Tool supply-chain pinning. Stops. CVE-2025-54136 is a rug pull: approval given once, definition changed after. The how-to records a SHA-256 of each definition in a reviewed file and blocks and shows the diff when it changes; its repo-config check blocks a cloned repository's
.mcp.jsonunless its hash is on a reviewed list. Limit: the pin file must live where the agent and the repository's writers cannot edit it without review, or the attacker who can swap the entry can swap the pin. - MCP server and client hardening. Limits. An approved-server list refuses a server that was added by an injection, and local servers started in a container with no network and no capabilities reach little. A swapped command on a listed server is the pinning case above.
- Tool allowlist and argument validation. Stops. A list of directories the agent may write to, rather than a list of sensitive file names, would not depend on getting the name right, which is the failure in CVE-2025-59944. Whichever you choose, compare paths after the same normalization the file system applies.
- Human approval gates. Stops. The fixes for 54135 and 54136 are approval gates on configuration changes; the same gate belongs in your own harness.
mcp-remote: a server that attacks the client that connects to it (CVE-2025-6514, July 2025)
What the agent could do. mcp-remote is a local proxy that lets MCP clients such as desktop assistants talk to a remote MCP server.
What happened. JFrog's research team found OS command injection in mcp-remote through crafted input in the authorization_endpoint of the server's response. Connecting to an untrusted server could run commands on the client machine: arbitrary shell commands on Windows, arbitrary executables with limited parameters on macOS and Linux. JFrog's affected range is 0.0.5 to 0.1.15, fixed in 0.1.16, CVSS 9.6.10 Two scenarios: connecting to a hijacked or malicious server, and connecting over plain HTTP where someone on the local network can intercept the traffic.10 The CVE record, published 9 Jul 2025, gives the same description.11
Primary sources. The researchers' post10 and the CVE record11.
Controls that fit.
- MCP server and client hardening. Stops. The attack required connecting to a server the user did not control or over an unprotected connection. A client that admits only servers on an approved list and requires HTTPS removes both scenarios. JFrog's mitigations are the same two things: update, and connect only to trusted servers over HTTPS.10 Limit: a hijacked server that is on the approved list is still hostile; that is the case for the next two controls.
- Tool supply-chain pinning. Limits. Pinned package versions with a record of what runs where tell you which machines hold 0.0.5 to 0.1.15 and move them to 0.1.16 on purpose.
- Sandboxed code execution. Limits. If the proxy runs in a container with no credentials and no route to anything but its server, an injected command lands there. This only helps when you can run the proxy in that container; a desktop client that launches it on the host cannot be confined this way.
MCP Inspector: a debugging tool with no authentication between its parts (CVE-2025-49596, June 2025)
What the agent could do. MCP Inspector is the project's developer tool for testing servers. Its proxy starts MCP commands over stdio on behalf of the browser client.
What happened. Versions below 0.14.1 had no authentication between the Inspector client and its proxy, so unauthenticated requests could make the proxy launch commands. The project's advisory credits Rémy Marot of Tenable and says to upgrade to 0.14.1 or later; the CVE record was published 13 Jun 2025.1213
Primary sources. The project's GitHub advisory12 and the CVE record13.
What this teaches. The tools around an agent are part of its attack surface. This one never involved a model.
Controls that fit.
- MCP server and client hardening. Limits. It covers local servers contained in a container and servers that reject callers without a valid token; the same standard applies to the developer tooling that launches those servers. The how-to's own review step runs the Inspector's command-line mode with the server in a container with no network.
- Tool supply-chain pinning. Limits. Pinning the tool's version and reviewing its updates puts the move to 0.14.1 under your control.
- Sandboxed code execution. Limits. A proxy that launches commands is a code-execution surface; run it where a launched command reaches nothing you care about.
Amazon Q Developer extension: a malicious release through an over-scoped CI token (July 2025)
What the agent could do. The Amazon Q Developer extension adds AI coding assistance to VS Code and is built from an open-source repository.
What happened. AWS's bulletin of 23 Jul 2025 (updated 25 Jul) says the extension's CodeBuild configuration held "an inappropriately scoped GitHub token". With it, a threat actor committed malicious code to the open-source repository, and it was included automatically in a release, version 1.84.0. AWS says the code was distributed but did not execute because of a syntax error, so it made no changes to customer environments. AWS revoked and replaced the credentials, removed the code, withdrew 1.84.0, and released 1.85.0, and gives a SHA-256 for the 1.84.0 package. It advises removing 1.84.0 everywhere, including forks, because the code is still present in existing installs.14 The GitHub advisory GHSA-7g7f-ff96-5gcw repeats the bulletin.15 The CVE-2025-8217 record adds that the injected code was designed to call the Q Developer CLI and runs when the extension launches, and that a syntax error stopped its call to the CLI.21
Primary sources. AWS's security bulletin14, the GitHub advisory15 and the CVE record21.
Controls that fit.
- Scoped, short-lived credentials. Stops. The root cause in AWS's words is a token scoped too widely. A token that cannot commit to the repository or alter what a build releases would have broken the chain at its first step.
- Tool supply-chain pinning. Stops, for a team that pins. A team that pins the extension to a reviewed version, and updates by reviewing the change, would not have taken 1.84.0 on the day it shipped. Limit: that needs auto-update turned off, and it only helps if the review reads the code; the bulletin's published hash lets you check which build you hold.
Nx "s1ngularity": a poisoned package that asked the victim's own AI tools to find secrets (August 2025)
What the agent could do. Local AI command-line tools run with the developer's own file access and sign-in. Any code that runs on the machine can try to start them.
What happened. On 26 Aug 2025, malicious versions of nx and several @nx/* packages were published to npm using the project's npm publishing token, which was taken through a GitHub Actions workflow injection: a pull-request-title check ran with a pull_request_target trigger, which gave it elevated permissions, and was used to trigger the publish workflow with a malicious change that sent the token to a webhook.16 The advisory lists the affected versions as nx 20.9.0, 20.10.0, 20.11.0, 20.12.0, 21.5.0, 21.6.0, 21.7.0 and 21.8.0; @nx/devkit, @nx/js, @nx/node and @nx/workspace 20.9.0 and 21.5.0; @nx/eslint 21.5.0; and @nx/key and @nx/enterprise-cloud 3.2.0.16 The Nx advisory says a postinstall script scanned the file system for text files, collected paths and credentials, and posted them as an encoded string to a new public GitHub repository under the victim's own account (named with s1ngularity-repository). It also appended sudo shutdown -h 0 to .zshrc and .bashrc. The advisory's appendix reproduces the script's prompt, which tells a "file-search agent" to list text configuration and environment files and write the paths to /tmp/inventory.txt.16 Nx's post-mortem says the script "attempted to use local AI tools (like Claude and Gemini)" and uploaded results through the GitHub CLI; the packages were live for about four hours; and provenance signing was absent on the malicious packages but "provenance doesn't block unsigned packages from being installed".17 Nx Console versions 18.6.30 to 18.65.1 for VS Code installed the latest nx on launch, so some victims were affected without using Nx; Nx Console 18.66.0 removed that check.16
Primary sources. Nx's GitHub advisory GHSA-cxm3-wv7p-598c16 and Nx's post-mortem17.
What this teaches. The agent here belonged to the victim, and the attacker supplied the instruction. A local agent with file-system and credential reach is a capability that other code on the machine can use.
Controls that fit.
- Tool supply-chain pinning. Limits. Lockfile hashes and exact versions mean a freshly published version is not installed by a routine install from the lockfile. Limit: a tool that installs
nx@latestby itself, as Nx Console did, bypasses the lockfile. Nx says the malicious versions lacked provenance signing; a check of your own that refuses a version published without it would have refused them, but this how-to does not build that check. - Sandboxed code execution. Limits. Install scripts and agent runs inside a container with no credentials mounted find nothing to inventory and reach no signed-in CLI.
- Scoped, short-lived credentials. Limits. The upload used the victim's GitHub CLI token. A short-lived, narrow token limits what the script's output can contain.
- Egress allowlist. Limits, weakly. The upload went to GitHub, which a developer machine's allowlist usually permits, and a hostname entry cannot tell the user's own new repository from any other. It would stop sending to other hosts, not this path.
- Human approval gates. Limits. If your AI tools ask before reading outside the project, a script cannot drive them silently. This is a design point, not a finding about how the script ran.
Sources
- CVE-2025-32711 record (M365 Copilot Information Disclosure Vulnerability), CVE Program record published 11 Jun 2025 by Microsoft, https://cveawg.mitre.org/api/cve/CVE-2025-32711, read 29 Nov 2026
- CVE-2025-32711, M365 Copilot Information Disclosure Vulnerability, Microsoft Security Update Guide (read as data from https://api.msrc.microsoft.com/sug/v2.0/en-US/vulnerability/CVE-2025-32711; the page is https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-32711), Microsoft Security Response Center, read 29 Nov 2026
- GitHub MCP Exploited: Accessing private repositories via MCP, Invariant Labs, 26 May 2025, https://invariantlabs.ai/blog/mcp-github-vulnerability, read 29 Nov 2026
- GitHub Copilot: Remote Code Execution via Prompt Injection (CVE-2025-53773), Embrace The Red, 12 Aug 2025, https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/, read 29 Nov 2026
- CVE-2025-53773 record (GitHub Copilot and Visual Studio Remote Code Execution Vulnerability), CVE Program record published 12 Aug 2025 by Microsoft, https://cveawg.mitre.org/api/cve/CVE-2025-53773, read 29 Nov 2026
- Arbitrary code execution from Cursor Agent through a prompt injection via MCP Special Files (GHSA-4cxx-hrm3-49rm), cursor/cursor security advisory, 2 Aug 2025, https://github.com/cursor/cursor/security/advisories/GHSA-4cxx-hrm3-49rm, read 29 Nov 2026
- CVE-2025-54135 record, CVE Program, https://cveawg.mitre.org/api/cve/CVE-2025-54135, read 29 Nov 2026
- Modification of MCP Server Definitions Bypasses Manual Re-approval (GHSA-24mc-g4xr-4395, CVE-2025-54136), cursor/cursor security advisory, 1 Aug 2025, https://github.com/cursor/cursor/security/advisories/GHSA-24mc-g4xr-4395, read 29 Nov 2026
- CVE-2025-59944 record (Cursor IDE: Sensitive File Overwrite Bypass is Possible), CVE Program, published 3 Oct 2025, https://cveawg.mitre.org/api/cve/CVE-2025-59944, read 29 Nov 2026
- Critical RCE Vulnerability in mcp-remote: CVE-2025-6514 Threatens LLM Clients, JFrog Security Research, 9 Jul 2025, https://jfrog.com/blog/2025-6514-critical-mcp-remote-rce-vulnerability, read 29 Nov 2026
- CVE-2025-6514 record, CVE Program, published 9 Jul 2025, https://cveawg.mitre.org/api/cve/CVE-2025-6514, read 29 Nov 2026
- Inspector proxy server vulnerabilities (GHSA-7f8r-222p-6f5g), modelcontextprotocol/inspector security advisory, https://github.com/modelcontextprotocol/inspector/security/advisories/GHSA-7f8r-222p-6f5g, read 29 Nov 2026
- CVE-2025-49596 record, CVE Program, published 13 Jun 2025, https://cveawg.mitre.org/api/cve/CVE-2025-49596, read 29 Nov 2026
- Security Update for Amazon Q Developer Extension for Visual Studio Code (Version #1.84), AWS-2025-015, Amazon Web Services, published 23 Jul 2025, https://aws.amazon.com/security/security-bulletins/AWS-2025-015/, read 29 Nov 2026
- GHSA-7g7f-ff96-5gcw, aws/aws-toolkit-vscode security advisory, https://github.com/aws/aws-toolkit-vscode/security/advisories/GHSA-7g7f-ff96-5gcw, read 29 Nov 2026
- Malicious versions of Nx and some supporting plugins were published (GHSA-cxm3-wv7p-598c), nrwl/nx security advisory, 27 Aug 2025, https://github.com/nrwl/nx/security/advisories/GHSA-cxm3-wv7p-598c, read 29 Nov 2026
- S1ngularity - What Happened, How We Responded, What We Learned, Nx Blog, 5 Sep 2025, https://nx.dev/blog/s1ngularity-postmortem, read 29 Nov 2026
- CVE-2025-54136 record, CVE Program, published 1 Aug 2025, https://cveawg.mitre.org/api/cve/CVE-2025-54136, read 29 Nov 2026
- EchoLeak: The First Real-World Zero-Click Prompt Injection Exploit in a Production LLM System, arXiv:2509.10540, https://arxiv.org/html/2509.10540, read 29 Nov 2026
- Cursor IDE - Sensitive File Overwrite Bypass (GHSA-xcwh-rrwj-gxc7), cursor/cursor security advisory, https://github.com/cursor/cursor/security/advisories/GHSA-xcwh-rrwj-gxc7, read 29 Nov 2026
- CVE-2025-8217 record (Amazon Q Developer Visual Studio Code extension), CVE Program, published 30 Jul 2025, https://cveawg.mitre.org/api/cve/CVE-2025-8217, read 29 Nov 2026