Cursor Remote Code Execution Vulnerability (CVE-2025-54135)

Cursor Remote Code Execution Vulnerability (CVE-2025-54135)

August 7, 2025 | NSFOCUS

Overview

Recently, NSFOCUS CERT detected that Cursor issued a security bulletin and fixed the Cursor remote code execution vulnerability (CVE-2025-54135); Because Cursor allows files to be written to the workspace without user approval, when an external Model Control Protocol (MCP) server is configured through the Cursor user interface, an attacker can use Agent to rewrite the victim’s Cursor configuration file by returning a prompt from the external service. If a file like .cursor/mcp.json does not exist, A Cursor with “Auto-Run” enabled will immediately execute the malicious commands injected into the Agent, enabling remote code execution on the target host. The CVSS score is 8.6. At present, the vulnerability details and PoC have been made public. Relevant users are requested to take measures to protect themselves as soon as possible.

Cursor is an AI code editor developed based on VS Code, which deeply integrates AI models (such as GPT-4 or Claude) and supports natural language code generation, auto-completion, error repair, code refactoring and other functions. Cursor introduced the Model Context Protocol (MCP), which allows agents to access external services through natural language interfaces.

Vulnerability exploitation process:

Reference link: https://github.com/cursor/cursor/security/advisories/GHSA-4cxx-hrm3-49rm

Scope of Impact

Affected versions

  • Cursor <= 1.2.1

Unaffected version

  • Cursor >= 1.3.9

Mitigation

Official upgrade

At present, the official has released a new version to fix this vulnerability. Affected users are requested to upgrade their protection as soon as possible. Download link: https://cursor.com/downloads

Other measures

If the relevant users are temporarily unable to perform upgrade operations, the following measures can be used temporarily:

1. Turn off the Auto-Run Mode function in Cursor Settings:

2. Troubleshoot and prohibit adding MCP servers from unknown sources.

Statement

This advisory is only used to describe a potential risk. NSFOCUS does not provide any commitment or promise on this advisory. NSFOCUS and the author will not bear any liability for any direct and/or indirect consequences and losses caused by transmitting and/or using this advisory. NSFOCUS reserves all the rights to modify and interpret this advisory. Please include this statement paragraph when reproducing or transferring this advisory. Do not modify this advisory, add/delete any information to/from it, or use this advisory for commercial purposes without permission from NSFOCUS.

About NSFOCUS

NSFOCUS, a pioneering leader in cybersecurity, is dedicated to safeguarding telecommunications, Internet service providers, hosting providers, and enterprises from sophisticated cyberattacks.

Founded in 2000, NSFOCUS operates globally with over 4000 employees at two headquarters in Beijing, China, and Santa Clara, CA, USA, and over 50 offices worldwide. It has a proven track record of protecting over 25% of the Fortune Global 500 companies, including four of the five largest banks and six of the world’s top ten telecommunications companies.

Leveraging technical prowess and innovation, NSFOCUS delivers a comprehensive suite of security solutions, including the Intelligent Security Operations Platform (ISOP) for modern SOC, DDoS Protection, Continuous Threat Exposure Management (CTEM) Service and Web Application and API Protection (WAAP). All the solutions and services are augmented by the Security Large Language Model (SecLLM), ML, patented algorithms and other cutting-edge research achievements developed by NSFOCUS.