Description
Markdown Preview Enhanced before 0.8.28 opens external files and links from the preview through a shell and does not validate untrusted inputs taken from the markdown document - the diagram filename attribute, imported file paths, and the latex_engine code-chunk attribute. On Windows, a crafted markdown document can inject operating system commands that execute when the document is previewed. Fixed in 0.8.28 by passing these inputs as literal arguments instead of through a shell and validating them before use.
Published: 2026-06-05
Score: 8.6 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Markdown Preview Enhanced for Visual Studio Code processes links and external file references embedded in markdown documents by invoking a shell to load them. The extension does not sanitize values supplied by the document, such as diagram file names, imported paths, or LaTeX engine options. On Windows a crafted markdown file can embed shell commands that are executed when the document is previewed, allowing an attacker to run arbitrary code with the privileges of the editor’s user. The flaw is classified as a CWE‑78 Operating System Command Injection.

Affected Systems

All installations of the Markdown Preview Enhanced extension older than version 0.8.28 are vulnerable. The affected product is the Visual Studio Code extension by shd101wyy, identified in the CPE as markdown_preview_enhanced_project:markdown_preview_enhanced. Users who enable the preview and open local or network‑trusted markdown files that reference external resources are at risk.

Risk and Exploitability

CVSS base score is 8.6, indicating high severity. The EPSS score is not available, so the current exploitation likelihood cannot be quantified, but the absence of mitigation in the vulnerable builds and the high severity suggest a significant risk. The vulnerability is not listed in the CISA KEV catalog. Attackers would likely deliver a malicious file through shared drives or email attachments and entice a user to preview it, after which the injected commands would run. Because the vulnerability is triggered by local file access, any user with ability to open such a file on a machine with the extension installed is a potential attack vector.

Generated by OpenCVE AI on June 5, 2026 at 20:05 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Markdown Preview Enhanced extension to version 0.8.28 or later to apply input validation and shell usage changes.
  • If an upgrade cannot be applied immediately, disable the Markdown Preview Enhanced extension completely in VS Code.
  • In environments where the extension must remain enabled, configure editor settings or apply a policy that removes or sanitizes external file and link references before previewing.
  • Restrict file system permissions so that only trusted users can open markdown documents that trigger the extension.

Generated by OpenCVE AI on June 5, 2026 at 20:05 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 opens external files and links from the preview through a shell and does not validate untrusted inputs taken from the markdown document - the diagram filename attribute, imported file paths, and the latex_engine code-chunk attribute. On Windows, a crafted markdown document can inject operating system commands that execute when the document is previewed. Fixed in 0.8.28 by passing these inputs as literal arguments instead of through a shell and validating them before use.
Title Markdown Preview Enhanced OS Command Injection in External File and Link Opening
First Time appeared Markdown Preview Enhanced Project
Markdown Preview Enhanced Project markdown Preview Enhanced
Weaknesses CWE-78
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.057Z

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

Link: CVE-2026-49492

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Deferred

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

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

Link: CVE-2026-49492

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-05T20:15:09Z

Weaknesses