Two critical vulnerabilities (CVE-2025-54135 and CVE-2025-54136) in Cursor's Model Context Protocol server allow attackers to execute arbitrary commands and access files outside allowed directories.
CVE-2025-54135
Critical (CVSS 9.8)
Command Injection / RCE
Cursor MCP Server
Network (Prompt Injection)
January 2025
CVE-2025-54136
High (CVSS 8.1)
Path Traversal / Directory Escape
Cursor MCP File Operations
Network (Prompt Injection)
Arbitrary File Read/Write
The Cursor MCP server's command execution functionality fails to properly sanitize inputs before passing them to the system shell. When the AI model invokes terminal commands, specially crafted inputs can break out of the intended command context and execute arbitrary code.
// Vulnerable code pattern (simplified)
const command = `git status ${userInput}`;
exec(command); // userInput not sanitized
// Attack payload: "; rm -rf / #"
// Results in: git status ; rm -rf / #The file system operations in Cursor's MCP server do not properly validate file paths. By using path traversal sequences (../) or symlinks, an attacker can read or write files outside the intended project directory.
// Intended: Read files only in /project/src
readFile("/project/src/config.ts")
// Attack: Path traversal to read sensitive files
readFile("/project/src/../../../.ssh/id_rsa")
readFile("/project/src/../../../.aws/credentials")Access to SSH keys, AWS credentials, API tokens, and other secrets stored on the developer's machine
Read any file on the system including proprietary source code and configuration
Modify system files or install persistent malware that survives reboots
Use compromised credentials to access cloud resources, CI/CD pipelines, and production systems
Ensure you're running the latest version of Cursor with security patches applied
If using 'Yolo mode' (auto-accept commands), disable it or use strict allowlists
Carefully review and approve each terminal command before execution
Run Cursor in containers or VMs without access to sensitive credentials
Be cautious with external repositories, packages, and websites you ask Cursor to analyze
Applications built with AI coding tools need security scanning. Find vulnerabilities before attackers do.
Scan Your App FreeLast updated: January 2025