CVE-2026-54701

Markdown Preview Enhanced: Stored XSS via Unsanitized `.crossnote/head.html` Injection in Webview

Published Oct 14, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
Markdown Preview Enhanced is a Markdown preview extension for Visual Studio Code. Prior to 0.8.30, Markdown Preview Enhanced reads repository-controlled .crossnote/head.html content and passes it through resolvePathsInHeader before inserting it into the head of the preview webview document without removing executable content. Script-capable markup executes while the document loads, before the React application and DOMPurify initialize, and can access acquireVsCodeApi to send messages from the webview to the extension host. Opening a Markdown preview in a malicious repository is sufficient to trigger the injected content, and no additional click within the notification or preview is required. This issue is fixed in version 0.8.30.

Analysis

AI-generated

Technical impact

The vulnerability allows an attacker to embed malicious script payloads in a repository-controlled .crossnote/head.html file, which the Markdown Preview Enhanced extension injects into the preview webview without sanitization. The injected code executes while the document loads, before the React application and DOMPurify are initialized, and can access the acquireVsCodeApi API. Through that API, the attacker can send arbitrary messages from the webview to the extension host, potentially enabling execution of arbitrary code with the extension’s privileges.

Affected Systems

The issue affects the shd101wyy vscode-markdown-preview-enhanced extension for Visual Studio Code. Any installation of a version prior to 0.8.30 is vulnerable. Users of version 0.8.30 or later have the fix applied.

Risk and Exploitability

The CVSS score for this flaw is 6.9, indicating moderate severity, and there is no EPSS score available. It is not listed in the CISA KEV catalog. Because the vulnerability is triggered simply by opening a Markdown preview in a malicious repository, no additional user interaction is required. An attacker only needs to host a repository with a crafted .crossnote/head.html file and entice a victim to preview a markdown file in that repository. Once the preview is rendered, the injected script runs with the extension’s context, allowing remote code execution inside the extension host.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update to Markdown Preview Enhanced v0.8.30 or later to eliminate the stored XSS vulnerability.
  • Configure Visual Studio Code’s workspace trust settings to disallow loading previews from untrusted repositories, thereby limiting where the extension can inject content.
  • If an immediate update is not possible, disable or uninstall the Markdown Preview Enhanced extension to remove the vulnerable attack surface.

Generated by OpenCVE AI on October 15, 2026 at 13:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Markdown Preview Enhanced is a Markdown preview extension for Visual Studio Code. Prior to 0.8.30, Markdown Preview Enhanced reads repository-controlled .crossnote/head.html content and passes it through resolvePathsInHeader before inserting it into the head of the preview webview document without removing executable content. Script-capable markup executes while the document loads, before the React application and DOMPurify initialize, and can access acquireVsCodeApi to send messages from the webview to the extension host. Opening a Markdown preview in a malicious repository is sufficient to trigger the injected content, and no additional click within the notification or preview is required. This issue is fixed in version 0.8.30.
Title Markdown Preview Enhanced: Stored XSS via Unsanitized `.crossnote/head.html` Injection in Webview
Weaknesses CWE-79
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N'}

Subscriptions

No data.

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 20, 2026, 2:01 AM
Reserved
Jun 15, 2026, 10:58 PM
Status
Awaiting Analysis
Published
Oct 14, 2026, 8:17 PM
Modified
Oct 20, 2026, 3:17 AM