Skip to content
MediumVulnerabilityLLM-specific

CVE-2024-48919: Cursor terminal command generation prompt injection via imported web page

Identifier
CVE-2024-48919
Published
Record updated
View JSON
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.5%

Summary

CVE-2024-48919 affects Cursor, a code editor built for programming with AI. Before September 27, 2024, an attacker controlling a web page that a user explicitly imported into the Terminal Cmd-K prompt could influence a language model to output arbitrary commands for execution in the user's terminal. Exploitation required the user to opt in to including the compromised page's contents and the attacker to embed prompt injection text in that page.

Mitigation

A server-side patch stopped streaming back newlines or control characters, released September 27, 2024. Cursor 0.42 adds client-side mitigations that prevent newlines or control characters from being streamed into the terminal directly, and a new setting, "cursor.terminal.usePreviewBox", which when set to true streams the response into a preview box that must be manually accepted before insertion into the terminal. The server-side patch applies to older versions of Cursor, so no additional action is needed for it. Cursor's maintainers also recommend including only trusted pieces of context in prompts.