Ameeba Chat App store presentation
Join the Cybersecurity Chat on Ameeba
Connect with pros, students, and researchers — in real time

Ameeba Blog Search

CVE-2025-61591: Command Injection Vulnerability in Cursor Code Editor

Ameeba’s Mission: Our mission is to safeguard freedom from surveillance through anonymization.

Overview

In the world of programming, code editors play a crucial role. One such editor, Cursor, which is built specifically for AI programming, has been identified with a severe vulnerability (CVE-2025-61591) in versions 1.7 and below. This vulnerability, if exploited, could lead to system compromise or data leakage, posing significant security threats to organizations and individuals using the affected versions of Cursor. The exploit works when MCP uses OAuth authentication with an untrusted MCP server, leading to potential remote code execution and command injection.

Vulnerability Summary

CVE ID: CVE-2025-61591
Severity: High (8.8)
Attack Vector: Network
Privileges Required: Low
User Interaction: Required
Impact: Potential system compromise or data leakage

Affected Products

Ameeba Chat Icon Escape the Surveillance Era

Most apps won’t tell you the truth.
They’re part of the problem.

Phone numbers. Emails. Profiles. Logs.
It’s all fuel for surveillance.

Ameeba Chat gives you a way out.

  • • No phone number
  • • No email
  • • No personal info
  • • Anonymous aliases
  • • End-to-end encrypted

Chat without a trace.

Product | Affected Versions

Cursor | 1.7 and below

How the Exploit Works

The exploit works when the Cursor code editor interacts with an untrusted MCP server using OAuth authentication. During this interaction, an attacker can impersonate a malicious MCP server and return crafted, maliciously injected commands. These commands could allow arbitrary code execution on the host by the agent, leading to a system compromise. The attacker could then run arbitrary commands with full user privileges, potentially leading to data leakage or further system compromise.

Conceptual Example Code

Below is a conceptual example of how this vulnerability might be exploited:

POST /mcp/oauth/token HTTP/1.1
Host: untrusted-mcp-server.com
Content-Type: application/json
{
"grant_type": "authorization_code",
"code": "AUTH_CODE",
"redirect_uri": "http://localhost:8080/callback",
"client_id": "CLIENT_ID",
"client_secret": "CLIENT_SECRET",
"commands": "{malicious_commands}"
}

In this example, the attacker impersonates the MCP server and sends a response containing malicious commands in the `commands` field. These commands could be crafted to exploit the command injection vulnerability in the Cursor code editor, leading to arbitrary code execution.

Mitigation Guidance

While the issue has no fixed release version yet, a patch (2025.09.17-25b418f) has been provided by the vendor. Users are strongly advised to apply this patch immediately to mitigate the risk. In case the patch cannot be applied immediately, using a Web Application Firewall (WAF) or an Intrusion Detection System (IDS) can serve as temporary mitigation. These systems can help detect and block malicious traffic, thereby reducing the risk of exploitation. Users should also ensure only trusted MCP servers are used for OAuth authentication to avoid potential exploitation.

Want to discuss this further? Join the Ameeba Cybersecurity Group Chat.

Disclaimer:

The information and code presented in this article are provided for educational and defensive cybersecurity purposes only. Any conceptual or pseudocode examples are simplified representations intended to raise awareness and promote secure development and system configuration practices.

Do not use this information to attempt unauthorized access or exploit vulnerabilities on systems that you do not own or have explicit permission to test.

Ameeba and its authors do not endorse or condone malicious behavior and are not responsible for misuse of the content. Always follow ethical hacking guidelines, responsible disclosure practices, and local laws.
Ameeba Chat