Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessVictim opens malicious repository locally
-
DeliveryOpen Markdown preview in VS Code
-
Exploithead.html script injected into webview head
-
ExecutionExecutes before DOMPurify/CSP initialize
-
PersistReaches acquireVsCodeApi, messages extension host
-
ImpactAbuse host command dispatch for impact
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires: (1) the Markdown Preview Enhanced extension installed in VS Code; (2) the victim opening/cloning an attacker-controlled repository that contains a .crossnote/head.html file with script-capable markup; and (3) the victim opening a Markdown preview for a file in that repository (UI:P - merely opening the preview triggers it; no click in the notification or preview is needed). Limiting factors: the vector is local (the malicious repo must be present on the victim's machine), the specific .crossnote/head.html path must exist in the repo, and the extension must be installed and used to render a preview - there is no remote network trigger. Only versions prior to 0.8.30 are affected. |
| Impact | This is a moderate-severity, developer-targeted vulnerability rather than a mass-exploitation priority. The vendor CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:P, score 6.9) correctly frames it as locally-vectored and requiring passive user interaction: exploitation depends on a victim cloning/opening a malicious repository and opening its Markdown preview, not on a remotely reachable network service. No EPSS score, CISA KEV listing, or SSVC decision data was provided, and no public exploit was referenced - so there is no public exploit identified at time of analysis and no evidence of active or automatable exploitation. The impact is meaningful: injected scripts in .crossnote/head.html execute before React, DOMPurify, and CSP defenses initialize, and can reach acquireVsCodeApi() to message the extension host, which (per the companion fix for blind command dispatch) could be chained toward arbitrary command invocation and file writes. This aligns with the vendor's VI:H (high integrity impact) while confidentiality/availability remain low. Net: a legitimate issue worth patching for anyone opening untrusted repositories, but its local vector and required user interaction keep it below the urgency of a network-exploitable flaw. Note the attack vector is local/UI-gated, so the raw '6.9' should not be read as remotely wormable. |
| Exploit ScenarioDerived | An attacker publishes a malicious repository containing a crafted .crossnote/head.html with embedded script markup. A developer with Markdown Preview Enhanced installed clones the repo and opens any Markdown file's preview; the injected script runs in the webview head before DOMPurify/CSP load and calls acquireVsCodeApi() to post messages to the extension host. No additional click in the notification or preview is required, and no public exploit code was referenced in the provided data. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 14, 2026
Script injection in Markdown Preview Enhanced (a Visual Studio Code extension) before 0.8.30 lets a malicious repository execute attacker-controlled JavaScript inside the preview webview as soon as a victim opens a Markdown preview. Because the injected code runs before the React application and DOMPurify are initialized, it can reach acquireVsCodeApi() and send arbitrary messages to the extension host, giving an attacker host-level command influence (integrity impact is rated High in the assessed vector). Exploitation requires the extension to be installed, the victim to have an attacker-controlled repository on disk, and the victim to open a preview of a Markdown file in that repository - the preview itself is the trigger and no further click is needed. No public exploit code has been identified at time of analysis and the issue is not confirmed as actively exploited (no CISA KEV listing); the vendor-released fix is 0.8.30, which upgrades the bundled crossnote library to 0.9.31.
RemediationAI
Vendor-released patch: upgrade Markdown Preview Enhanced to version 0.8.30 (vscode-markdown-preview-enhanced release 0.8.30) or later, which bumps the bundled crossnote dependency to 0.9.31 and removes all <script> tags from .crossnote/head.html before they are injected into the webview head; consumers of the standalone crossnote package should move to 0.9.31 (commit 8c55a2ba3365712a1caa4abeece0383bc2994d48, PR shd101wyy/crossnote#444) for the underlying fix. The equivalent extension-side change is commit 8bc848b6cbb42b9f35a0f95f7c3bf29b8302970e (PR shd101wyy/vscode-markdown-preview-enhanced#2323) and the advisory is at https://github.com/shd101wyy/vscode-markdown-preview-enhanced/security/advisories/GHSA-mcwg-4j78-qwv3. Because the malicious content lives in the repository, users who cannot update immediately should avoid opening Markdown previews for Markdown files inside untrusted or freshly cloned repositories, and should inspect or delete any .crossnote/head.html file in such repositories before previewing - after the fix, <style>, <meta>, and <link> tags in head.html still work, but <script> tags are stripped, so legitimate custom JavaScript in head.html will stop running (including in HTML and eBook exports generated through the same helper), which is the intended trade-off. Organizations can additionally isolate previewing of untrusted repositories to a container or disposable VM, since the vector is local and depends on the malicious repository being present on the developer's machine. Note that patching also closes a related blind command-dispatch issue in the webview message handler that is fixed in the same 0.8.30 / 0.9.31 release, so the upgrade should be treated as a combined hardening step rather than a single-line fix.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is a cross-site scripting class issue (CWE-79) arising from improper neutralization of repository-controlled markup during web page generation. Markdown Preview Enhanced reads a per-repository configuration file, .crossnote/head.html, and passes its contents through the internal resolvePathsInHeader() helper before injecting them into the <head> element of the preview webview document. Prior to the fix, that helper rewrote relative script paths but performed no sanitization, so any script-capable markup present in head.html was inserted verbatim into the webview. Because the injection occurs in the document head during load, it executes before the React preview application and before DOMPurify or content-security-policy defenses are active, which is the core reason the sanitization used for normal Markdown rendering did not protect this path. From inside the webview, injected script can walk React internals to obtain acquireVsCodeApi() and use the webview-to-extension postMessage channel to reach the extension host. The upstream commit in crossnote (8c55a2ba3365712a1caa4abeece0383bc2994d48) replaces the script-path-rewriting logic with unconditional removal of all <script> elements from head content, and notes that the same shared helper is used by the HTML and eBook export paths, so scripts in head.html are now also stripped from exported documents. The same release additionally hardens the webview message handler by enforcing an allowlist of 37 legitimate commands, validating that arguments are arrays, and constraining the updateMarkdown command to the preview's own source URI and to markdown file extensions, closing a related blind command-dispatch weakness.
Know when Visual Studio Code gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
AV:L and UI:R because the victim must locally open a malicious repo's preview; PR:N as no authentication is needed; VI:H since injected script reaches the extension host via acquireVsCodeApi.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
More in Visual Studio Code
View allVisual Studio Code Remote Code Execution Vulnerability. Rated high severity (CVSS 7.8), this vulnerability is no authent
Visual Studio Code Remote Code Execution Vulnerability. Rated high severity (CVSS 8.8), this vulnerability is remotely e
Security-feature bypass in Microsoft Visual Studio Code before 1.136.2 lets a remote, unauthenticated attacker defeat a
Remote code execution in Visual Studio Code (versions 1.0.0 up to but not including 1.141.1) is achievable through a pat
Privilege escalation in Microsoft Visual Studio Code allows remote unauthenticated attackers to elevate privileges over
Visual Studio Code Remote Code Execution Vulnerability. Rated high severity (CVSS 7.8), this vulnerability is no authent
Security-feature bypass in Microsoft Visual Studio Code lets a remote attacker deliver functionality from an untrusted c
Remote code execution in Visual Studio Code (versions 1.0.0 through 1.132.0) is enabled by a missing authorization check
Command injection in Visual Studio Code 1.0.0 through 1.141.0 allows an unauthenticated remote attacker to execute arbit
Remote code execution in Microsoft Visual Studio Code allows a network-based attacker to inject and execute arbitrary co
Remote code execution in Visual Studio Code versions 1.0.0 through 1.141.1 allows an unauthenticated, network-positioned
Authorization bypass in Visual Studio Code versions 1.0.0 through 1.136.1 allows an unauthenticated network attacker to
EUVD-2026-101584
NVD
CVE.org
EPSS
GitHub
Exploit-DB