Skip to main content

Markdown Preview Enhanced CVE-2026-49493

| EUVDEUVD-2026-34869 HIGH
Code Injection (CWE-94)
2026-06-05 VulnCheck GHSA-m5v2-jw65-jh59
8.6
CVSS 4.0 · NVD
Share

Severity by source

NVD PRIMARY
8.6 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Primary rating from NVD · only source for this CVE.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
A
Scope
X

Lifecycle Timeline

4
Patch available
Jun 05, 2026 - 20:02 EUVD
Source Code Evidence Fetched
Jun 05, 2026 - 18:44 vuln.today
Analysis Generated
Jun 05, 2026 - 18:44 vuln.today
CVSS changed
Jun 05, 2026 - 18:22 NVD
8.8 (HIGH) 8.6 (HIGH)

DescriptionCVE.org

Markdown Preview Enhanced before 0.8.28 parses Bitfield fenced code blocks with interpretJS(), which evaluates the block content as code via vm.runInNewContext(), allowing arbitrary code execution. A crafted markdown document containing a malicious bitfield code block executes attacker-controlled code on the server side when the document is rendered or exported. Fixed in 0.8.28 by parsing bitfield register definitions with JSON5.parse(), since they are purely data.

AnalysisAI

Arbitrary code execution in Markdown Preview Enhanced (shd101wyy) before 0.8.28 lets a crafted markdown document run attacker-controlled JavaScript when rendered or exported, because Bitfield fenced code blocks were evaluated through interpretJS() / vm.runInNewContext() instead of being parsed as data. CVSS 4.0 scores this 8.6 with network vector and active user interaction; no public exploit identified at time of analysis and the CVE is not listed in CISA KEV.

Technical ContextAI

Markdown Preview Enhanced is a popular markdown rendering extension (available for VS Code and Atom) maintained by shd101wyy, identified by CPE cpe:2.3:a:shd101wyy:markdown_preview_enhanced. The extension supports embedded diagrams via fenced code blocks, including Bitfield register diagrams. Pre-0.8.28 the Bitfield renderer passed the block body to an interpretJS() helper that ultimately called Node's vm.runInNewContext(), turning what should be a static data island (arrays of register-field objects) into an arbitrary JavaScript execution context. This is a textbook CWE-94 (Improper Control of Generation of Code, 'Code Injection'): untrusted input is concatenated into a code-evaluation API. The 0.8.28 release replaces interpretJS() with JSON5.parse(), and the same release also patches a parallel eval()-based RCE in the WaveDrom renderer (issue #2315) and a Windows command-injection issue in external link opening, indicating a broader audit of unsafe parsers.

RemediationAI

Vendor-released patch: upgrade Markdown Preview Enhanced to 0.8.28 or later (which pulls in crossnote 0.9.29), per the release at https://github.com/shd101wyy/vscode-markdown-preview-enhanced/releases/tag/0.8.28 and the VulnCheck advisory at https://www.vulncheck.com/advisories/markdown-preview-enhanced-arbitrary-code-execution-via-bitfield-interpretjs. Until the upgrade is rolled out, compensating controls include disabling or uninstalling the Markdown Preview Enhanced extension on machines that handle untrusted markdown (trade-off: loss of diagram/preview functionality), avoiding the 'open preview' and HTML/PDF export commands on markdown originating from external sources such as cloned repos, email attachments, or downloaded gists, and configuring code review or repo-scan rules to reject markdown containing `bitfield (and `wavedrom, which the same release patches) fenced blocks pending the upgrade; note the markdown-scanning approach can be bypassed by attribute or whitespace variations, so it is a stopgap rather than a substitute for patching.

Share

CVE-2026-49493 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy