RCE via .code-workspace files using Prompt Injection
High7.5CVE-2025-61590 · Published Oct 2, 2025
### Summary Visual Studio Code (and hence Cursor) supports [Workspaces](https://code.visualstudio.com/docs/editing/workspaces/workspaces). This allows the user to open more than a single folder and save specific settings (pretty similar to `.vscode/settings.json`) for the folders / project. Based on the documentation: > VS Code automatically creates an untitled workspace. In the background, VS Code automatically maintains a untitled.code-workspace file for you that contains all the folders and workspace settings from your current session This opens up an entire new attack vector if the user has a `.code-workspace` file in path (either untitled created automatically or a saved one). This is a very simple workspace file: ```json { "folders": [ { "path": "." } ], "settings": {} } ``` If an attacker is able to hijack the chat context of the victim (such as via a compromised MCP server), they can use prompt injection to make the Cursor Agent write into this file and modify the workspace. This leads to a bypass of [CVE-2025-54130](https://github.com/cursor/cursor/security/advisories/GHSA-vqv7-vq92-x87f) which can lead to RCE by writing to the `settings` section. ### Impact Th...
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| Cursor Product | < 1.7 | 1.7 |
Details and references
### Summary Visual Studio Code (and hence Cursor) supports [Workspaces](https://code.visualstudio.com/docs/editing/workspaces/workspaces). This allows the user to open more than a single folder and save specific settings (pretty similar to `.vscode/settings.json`) for the folders / project. Based on the documentation: > VS Code automatically creates an untitled workspace. In the background, VS Code automatically maintains a untitled.code-workspace file for you that contains all the folders and workspace settings from your current session This opens up an entire new attack vector if the user has a `.code-workspace` file in path (either untitled created automatically or a saved one). This is a very simple workspace file: ```json { "folders": [ { "path": "." } ], "settings": {} } ``` If an attacker is able to hijack the chat context of the victim (such as via a compromised MCP server), they can use prompt injection to make the Cursor Agent write into this file and modify the workspace. This leads to a bypass of [CVE-2025-54130](https://github.com/cursor/cursor/security/advisories/GHSA-vqv7-vq92-x87f) which can lead to RCE by writing to the `settings` section. ### Impact The impact could be as severe as RCE on the victim with no user approval if the attacker is able to hijack the user's chat context via prompt injection or some other means. ### Remediation Added the extension `code-workspace` to the list of sensitive files that require user approval.
- CVSS 3.1
- CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Severity from
- GitHub (reviewed advisory)
More Cursor advisories
All Cursor| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Nov 32025 | Sensitive File Protection Bypass - Path Manipulation Using Backslashes on Windows | High8.8 | 2.0 |
| Oct 22025 | Cursor CLI Agent - Sensitive File Overwrite Bypass | High7.1 | 2025.09.17-25b418f |
| Oct 22025 | Cursor IDE - Sensitive File Overwrite Bypass | High8.0 | 1.7 |
| Oct 22025 | Remote Code Execution in Cursor CLI via Cursor Agent MCP OAuth2 Communication | High8.8 | 2025.09.17-25b418f |
| Oct 22025 | Arbitrary code execution Permissive CLI Config in Cursor CLI | High8.8 | 2025.09.17-25b418f |
| Oct 22025 | Potential Information Leakage via Mermaid Diagram | Medium5.9 | 1.7 |