Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

IncidentMCP servers and tools

MCPoison: a swapped MCP config gives persistent code execution in Cursor

HighCursor

Cursor asked developers to approve an MCP server once and then trusted it forever, even if its command changed. A collaborator could commit a harmless config, wait for approval, then swap in a malicious command.

Replay the attack step by step in the Learning Center

How it happened

  1. An attacker with write access commits a harmless-looking MCP configuration to a shared repository.
  2. A collaborator opens the project and approves the server once.
  3. The attacker later changes the command in the same entry.
  4. Cursor keeps trusting the approved entry, so the new command runs every time the project opens.

Impact

Persistent code execution on developer machines.

The fix

Cursor 1.3 asks for approval again after any change to an MCP configuration.

Lessons

  • Tie each approval to the exact content approved, such as a hash, not to a name.
  • Treat agent configuration committed to repositories as executable code.
  • Re-check trust whenever configuration changes.

Sources