What’s Vulnerable › Vulnerabilities

CVE-2026-31854: Cursor Affected by Arbitrary Code Execution via Prompt Injection and Whitelist Bypass

Description

Cursor is a code editor built for programming with AI. Prior to 2.0 ,if a visited website contains maliciously crafted instructions, the model may attempt to follow them in order to “assist” the user. When combined with a bypass of the command whitelist mechanism, such indirect prompt injections could result in commands being executed automatically, without the user’s explicit intent, thereby posing a significant security risk. This vulnerability is fixed in 2.0.

Affected products

How to fix

Upgrade to a fixed version: cursor 2.0. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2026-31854 or the next vulnerability affects your stack