Junglewise Threat Intelligence

CVE-2026-50733: Markdown Preview Enhanced code injection in WaveDrom rendering

CVE-2026-50733 · Severity: high · CVSS 8.8 · Published 2026-06-05

Technologies: Shd101wyy Markdown Preview Enhanced. Vendors: Shd101wyy.

Executive brief

Markdown Preview Enhanced is a popular extension for VS Code and other editors used to render complex documents. A security flaw allows a malicious Markdown file to execute arbitrary code on a user's computer when the file is opened in the preview window. This could allow an attacker to steal sensitive data, modify system files, or gain persistent remote access to the victim's machine.

Technical details

An eval injection vulnerability exists in Markdown Preview Enhanced due to the unsafe use of window.eval() when parsing WaveDrom diagrams. The extension fails to sanitize input within WaveDrom fenced code blocks or <script type="WaveDrom"> tags, which are explicitly allowed by the internal sanitizer. An attacker can exploit this by crafting a Markdown file that executes JavaScript within the VS Code webview context. Because the webview lacks a restrictive Content Security Policy (CSP) and the extension's message-passing IPC channel lacks validation, the injected code can trigger internal commands like 'updateMarkdown' to perform arbitrary file writes on the host filesystem. The issue is fixed in version 0.8.28 by migrating to JSON5.parse() and implementing strict JSON sanitization for WaveDrom scripts.

Affected products

  • shd101wyy Markdown Preview Enhanced < 0.8.28

Timeline

  • 2026-06-02: disclosed: Issue reported on GitHub repository
  • 2026-06-05: patched: Version 0.8.28 released
  • 2026-06-05: advisory: NVD and VulnCheck advisories published

References

Related threats