The Agent Could Edit Its Own Rulebook: Four Copilot and Cursor CVEs With One Root Cause
On 10 November 2026 Xalgorix published a teardown of four 2025 CVEs in GitHub Copilot and Cursor that share one root cause: the AI agent could write to the very files that decide what it is allowed to do. A prompt-injected agent switched on Copilot auto-approve mode, a freshly written MCP entry executed before the user could reject it, an approved MCP server was swapped for a reverse shell without a re-prompt, and a protected-file guard fell to a change of letter case. We verified all four CVE records in NVD first-hand, pulled all three Cursor security advisories via the GitHub API, and read the original researcher write-ups for the Copilot and MCPoison bugs first-hand. None of the four appears in the CISA Known Exploited Vulnerabilities catalog as of 13 November 2026, which we checked directly — but every one of them was demonstrated end to end by its reporter, and the pattern they share is still the default shape of agent tooling.
CVE-2025-53773: Copilot turns on its own auto-approve
In June 2025 Johann Rehberger reported to Microsoft that a prompt injection — hidden in a source file, a web page, or a GitHub issue — could make Copilot agent mode add one line to the workspace .vscode/settings.json: chat.tools.autoApprove: true. That experimental flag, which Rehberger nicknamed YOLO mode, disabled all user confirmations, after which the next injected instruction ran terminal commands. His write-up, which we read first-hand, rests on two facts about Copilot agent mode at the time: it could create and modify workspace files without approval, and the edits were immediately persistent rather than held as a diff to review. His demonstration opened the calculator; the longer variant he described joined the machine to a command-and-control server. Xalgorix adds that he built a variant with invisible Unicode and credits Markus Vervier with an independent report — carried here as reported. NVD, read first-hand, lists the CVE as Analyzed, published 12 August 2025, CVSS 3.1 7.8 (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H), classified as command injection (CWE-77), referencing the MSRC entry and Rehberger post. The fix shipped in the 12 August 2025 updates, covering Visual Studio 2022 before 17.14.12.
CVE-2025-54135 (CurXecute): a new MCP server runs before you click reject
Cursor's first bug, nicknamed CurXecute by Aim Labs, started from a Slack MCP server connected to the editor. An attacker posted a message in a public channel; when the developer had the agent read Slack, the message told it to improve the MCP configuration by adding a new server whose command was attacker-chosen. The decisive detail is timing: Cursor started any new entry in its MCP config as soon as the file changed, so the agent edit landed on disk and triggered command execution even if the user rejected the suggestion — the approval UI was real, but it ran after the effect. Cursor advisory GHSA-4cxx-hrm3-49rm, pulled first-hand, lists the vulnerable range as 1.2.1 and below with the fix in 1.3.9; NVD, also read first-hand, published 5 August 2025. Xalgorix cites a CVSS 8.6 figure and a 7 July 2025 report date, carried here as stated. A second source confirms the core timing claim first-hand: BleepingComputer 1 August 2025 reporting on the Aim Security disclosure says suggested edits to the MCP config were live and triggered execution even on reject, with ransomware and data theft as the downstream risk. Aim own post is currently behind a challenge page (HTTP 403), so its internals are carried via Xalgorix and BleepingComputer, stated openly. Cursor advisory adds a second subtlety worth keeping: editing a dotfile required approval, but creating one that did not exist yet did not — so if .cursor/mcp.json was absent, the agent could write it unprompted. This site briefed the original GitHub advisory in February 2026; what the Xalgorix synthesis adds is the timing detail, the second-source confirmation, and the pattern that connects it to the other three.
CVE-2025-54136 (MCPoison): approval bound to a name
Check Point Research MCPoison finding needs no prompt injection at all, which is why it belongs in this set. Cursor asked the user to approve a project MCP server once — but the approval was tied to the server key name in the config, so future modifications to its command or arguments were trusted without any additional validation or prompt. Anyone with write access to a branch the victim pulls can make the swap: day one, a benign build-helper entry running echo gets approved and committed; day two, the same key carries sh -c with a payload, and it runs without a new prompt every time the victim opens the project. The Check Point research post, read first-hand (5 August 2025, by Charikov, Zaikin, and Vanunu), frames it exactly as a trust-over-time failure in MCP validation for shared repositories. Cursor advisory GHSA-24mc-g4xr-4395, pulled first-hand, lists versions below 1.2.4 as vulnerable with the fix in 1.3; NVD, read first-hand, scores it CVSS 3.1 7.2, the lower number reflecting the repository-write precondition. Xalgorix notes that since the fix, any change to an MCP entry — down to a single added space — forces a fresh approval, carried as reported.
CVE-2025-59944: a protected-file list that cared about case
Cursor guards a set of sensitive files, such as .cursor/mcp.json, so the agent cannot quietly rewrite them — the direct patch for the first two bugs. The fourth CVE defeats that patch: the guard compared paths case-sensitively, so on macOS and Windows, whose default filesystems are case-insensitive, a prompt-injected agent could target a differently cased path such as .cUrSoR/mcp.json, pass the check, and still write the real file. Cursor advisory GHSA-xcwh-rrwj-gxc7, pulled first-hand, lists versions below 1.6.23 as vulnerable with the fix in 1.7; NVD, read first-hand, published 3 October 2025. It is the same lesson web developers learned from parent-directory sequences and URL-encoding bypasses: a deny list over paths is only as good as its notion of path equality.
Four bugs, four distinct mistakes, one violated invariant
Read side by side, the bugs map onto four errors Xalgorix names explicitly, and each is worth checking for by name in any agent deployment. The policy was writable by the thing it governs: the Copilot auto-approve flag and the Cursor MCP list sat where the agent ordinary write tool could reach them, and a policy the subject can edit is a suggestion. Effects happened before review: edits were persisted and configs hot-reloaded first, the human asked afterwards — approval only counts if nothing irreversible happens until it is given. Trust was bound to an identifier: approving build-helper should mean approving one exact command and argument list, and binding trust to the name let the content change underneath it. Path checks used string equality: any guard over file paths must canonicalize first — resolve symlinks and parent references, normalize Unicode, fold case where the filesystem does. Two bugs abuse writable policy with immediate effect, one abuses name-bound trust, and one defeats the patch for the first two. The through-line for builders: the permission plane — settings, MCP definitions, approval state — must live outside the agent write scope, ideally in a user-level or managed location the workspace cannot override, with approvals gated on content rather than names and evaluated before effects, not after.
What to actually do
- Move agent permission files out of the workspace. Auto-approve flags, MCP server definitions, and allowlists must not sit where the agent file-write tool — or any prompt-injectable content stream — can reach them. If the workspace must carry them, treat them as untrusted input, never as policy.
- Make approval precede effect, and verify the order. An approve-or-reject dialog shown after the config already took effect is theater. Audit the sequence: persist, hot-reload, and execute must all wait for the human decision, including for newly created files, not just edits to existing ones.
- Bind trust to content, not to names. Re-prompt on any change to an approved entry command or arguments; better, pin the approved hash. The MCPoison fix — any MCP entry change forces fresh approval — is the minimum bar for shared repositories.
- Canonicalize before you compare paths. Resolve symlinks and parent references, normalize Unicode, and fold case on case-insensitive filesystems before enforcing protected-file lists. Test the guard with the bypass spellings, not just the canonical ones.
- Patch the editors and re-check the KEV catalog on your own cadence. Copilot fixes shipped August 2025; Cursor fixed the first pair in 1.3 and 1.3.9 and the case bypass in 1.7. None of the four is KEV-listed, which means scanner-only shops are blind to them — version inventory, not exploit feeds, is the control that catches this class.
Our verification was read-only. We confirmed first-hand via the NVD API that CVE-2025-53773 (Analyzed, published 12 August 2025, CVSS 3.1 7.8, CWE-77, MSRC and Embrace-the-Red references), CVE-2025-54135 (Analyzed, published 5 August 2025), CVE-2025-54136 (Analyzed, published 2 August 2025, CVSS 3.1 7.2), and CVE-2025-59944 (Analyzed, published 3 October 2025) exist as described, and via the GitHub API that Cursor advisories GHSA-4cxx-hrm3-49rm (1.2.1 and below vulnerable, fixed 1.3.9), GHSA-24mc-g4xr-4395 (below 1.2.4 vulnerable, fixed 1.3), and GHSA-xcwh-rrwj-gxc7 (below 1.6.23 vulnerable, fixed 1.7) carry these ranges. We read the Johann Rehberger Embrace the Red post (12 August 2025) and the Check Point Research MCPoison post (5 August 2025) first-hand, the BleepingComputer CurXecute report (1 August 2025) first-hand, and the CISA KEV catalog CSV directly on 13 November 2026 (latest additions 10 November, none of the four listed). Aim Security own CurXecute page refused automated fetching (HTTP 403) and the Microsoft MSRC page was unreadable to automation, so Aim disclosure internals and MSRC-side fix details are carried as reported via Xalgorix and BleepingComputer, stated openly. Xalgorix-specific claims — the 10 November 2026 date, the report dates, the invisible-Unicode variant, the Vervier independent report, the 29 July Cursor 1.3 date, the CVSS 8.6 figure for CVE-2025-54135, and the four-mistake framing — are carried as reported from the Xalgorix teardown, which we read first-hand. Brave Search was used for discovery only. We ran no agent, crafted no payload, touched no editor, and contacted no vendor.
Sources:
- Xalgorix — How Copilot and Cursor Agents Got RCE via Config Files (10 November 2026; read first-hand, vendor analysis carried as attributed)
- NVD — CVE-2025-53773 (Analyzed, CVSS 3.1 7.8, CWE-77; read first-hand)
- NVD — CVE-2025-54135 (Analyzed; read first-hand)
- NVD — CVE-2025-54136 (Analyzed, CVSS 3.1 7.2; read first-hand)
- NVD — CVE-2025-59944 (Analyzed; read first-hand)
- Cursor advisory GHSA-4cxx-hrm3-49rm — CVE-2025-54135 (fixed 1.3.9; read first-hand via API)
- Cursor advisory GHSA-24mc-g4xr-4395 — CVE-2025-54136 (fixed 1.3; read first-hand via API)
- Cursor advisory GHSA-xcwh-rrwj-gxc7 — CVE-2025-59944 (fixed 1.7; read first-hand via API)
- Embrace the Red — GitHub Copilot: Remote Code Execution via Prompt Injection, CVE-2025-53773 (12 August 2025; read first-hand)
- Check Point Research — Cursor IDE Vulnerability MCPoison (5 August 2025; read first-hand)
- BleepingComputer — AI-Powered Cursor IDE Vulnerable to Prompt-Injection Attacks (1 August 2025; read first-hand)
- al-ice.ai — The Notification, the Install Link, and the Redirect: Three MCP RCEs in VS Code 1.145
- al-ice.ai — No CVE, No Advisory, No Scanner Alert: OpenCode Silent Fix for an MCP OAuth RCE
- al-ice.ai — Approved Last Month, Replaced This Morning: Two-Thirds of Public MCP Servers Run Unpinned
- al-ice.ai — Microsoft Framework CVEs: Prompt Injection to RCE Across Semantic Kernel, CrewAI, LangChain
- al-ice.ai — Approved Once, Leaked Everywhere: Claude Code Do Not Ask Again File and GitHub Secret Exposure