MCPoison: How a Trusted AI Feature in Cursor Became a Hacker’s
Cursor did not re-prompt users when an approved MCP configuration file was later modified, so an attacker could change a benign command into a malicious one and have it run automatically. This allowed persistent remote code execution on the victim's machine each time the project was opened.
Published on rootissh.in
MCP, short for Multi-Command Package, is a feature in the Cursor AI code editor designed to streamline developer workflows. Think of it as a way to automate common tasks — like testing, building, or deploying — using simple natural language commands.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the editor treated the initial approval of an MCP file as permanent trust and did not re-validate the file when its contents changed.
Impact
An attacker could persistently run arbitrary commands on the victim's machine every time the project is opened, with no further warning.
What the attacker needed
Cursor version 1.2.4 or earlier; shared Git repository; victim approves the MCP once; attacker can later modify the MCP file
The fix
Cursor version 1.3 and later was fixed to re-prompt users when an MCP file is modified.
How it was found
- An attacker commits a benign-looking MCP file to a shared Git repository.
- A teammate opens the project and approves the MCP configuration.
- Later, the attacker modifies the MCP to include a malicious command.
- Cursor executes the modified command without asking for approval again.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
MCP is a feature in the Cursor code editor that lets developers define shell commands in a project file and approve them once. The bug is that Cursor kept trusting that file even after someone changed it, so a malicious teammate could swap a safe command for a harmful one and it would run without warning.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.