Severity by source
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
Lifecycle Timeline
4DescriptionCVE.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.
More in Markdown Preview Enhanced
View allAn issue in Markdown Preview Enhanced v0.6.5 and v0.19.6 for VSCode and Atom allows attackers to execute arbitrary comma
Markdown Preview Enhanced v0.6.5 and v0.19.6 for VSCode and Atom was discovered to contain a command injection vulnerabi
An issue in Visual Studio Code Extensions Markdown Preview Enhanced v0.8.18 allows attackers to execute arbitrary code v
Remote code execution in the Markdown Preview Enhanced extension (versions before 0.8.28) allows attackers to run arbitr
Remote code execution in Markdown Preview Enhanced before 0.8.28 on Windows allows attackers to inject OS commands throu
Arbitrary JavaScript execution in the Markdown Preview Enhanced VS Code extension (0.8.x, bundling crossnote 0.9.28) is
Same weakness CWE-94 – Code Injection
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-34869
GHSA-m5v2-jw65-jh59