Description
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.
Published: 2026-06-05
Score: 8.6 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability lies in the parsing of Bitfield fenced code blocks in Markdown Preview Enhanced before version 0.8.28. The extension’s interpretJS() function evaluates the content of these blocks using vm.runInNewContext(), treating the block body as executable JavaScript. Because the block is parsed as code, an attacker can embed arbitrary JavaScript that will run on the machine when the markdown file is rendered or exported, potentially gaining full control of that system. This is a classic code injection flaw classified as CWE‑94, meaning the attacker can run any code allowed by the host environment.

Affected Systems

The flaw affects users of the Markdown Preview Enhanced extension developed by shd101wyy. Any installation of a version earlier than 0.8.28 is vulnerable. The extension is available for the VSCode editor and can be installed from the visual studio marketplace. Devices running any operating system that hosts the VSCode editor with the affected extension are impacted.

Risk and Exploitability

The CVSS score of 8.6 indicates a high severity. EPSS is not available, so the likelihood of exploitation is uncertain, but the fact that the extension parses arbitrary content means that only a moderately skilled attacker needs a document to be opened on the target machine. The vulnerability is not listed in the CISA KEV catalog, so no active exploitation reports are public yet, but the potential remains for targeted attacks or abuse via malicious documents shared through collaboration tools.

Generated by OpenCVE AI on June 5, 2026 at 19:37 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update Markdown Preview Enhanced to 0.8.28 or later, which replaces Bitfield parsing with JSON5.parse() and removes the execution path.
  • If updating immediately is not possible, disable the Bitfield feature or set the extension to a development mode that ignores interpretJS() blocks, or open the document in a read‑only preview to avoid executing code.
  • As a last resort, uninstall Markdown Preview Enhanced entirely and use a trusted markdown renderer that does not evaluate embedded JavaScript until verified as safe.

Generated by OpenCVE AI on June 5, 2026 at 19:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 05 Jun 2026 18:15:00 +0000

Type Values Removed Values Added
Description 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.
Title Markdown Preview Enhanced Arbitrary Code Execution via Bitfield interpretJS()
First Time appeared Markdown Preview Enhanced Project
Markdown Preview Enhanced Project markdown Preview Enhanced
Weaknesses CWE-94
CPEs cpe:2.3:a:markdown_preview_enhanced_project:markdown_preview_enhanced:*:*:*:*:*:*:*:*
Vendors & Products Markdown Preview Enhanced Project
Markdown Preview Enhanced Project markdown Preview Enhanced
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.6, 'vector': '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'}


Subscriptions

Markdown Preview Enhanced Project Markdown Preview Enhanced
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-06-05T17:49:52.826Z

Reserved: 2026-05-31T11:54:34.993Z

Link: CVE-2026-49493

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Deferred

Published: 2026-06-05T18:17:33.723

Modified: 2026-06-05T18:59:54.823

Link: CVE-2026-49493

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-05T19:45:03Z

Weaknesses