Markdown Preview Enhanced for Visual Studio Code versions prior to 0.8.30 contain a vulnerability where the webview message handler accepts attacker-controlled commands and arguments without validation. This allows JavaScript executing in the preview webview to invoke privileged extension commands, including file modification and code execution. Exploitation requires a separate JavaScript execution vector in the webview, but no additional authorization checks exist. The issue is fixed in version 0.8.30.
Markdown Preview Enhanced for Visual Studio Code versions prior to 0.8.30 contains a cross-site scripting (XSS) vulnerability. The extension reads repository-controlled .crossnote/head.html content and inserts it into the preview webview's head without removing executable script content. This allows script execution before React and DOMPurify initialize, enabling malicious scripts to run when opening a Markdown preview in a malicious repository without further user interaction. The issue is fixed in version 0.8.30.
Markdown Preview Enhanced for Visual Studio Code prior to version 0.8.30 contains a vulnerability where the _crossnote.updateMarkdown command accepts arbitrary URIs and attacker-controlled content, allowing file writes without proper validation. This can be exploited by JavaScript executing in the preview webview to write files accessible by the user's OS privileges. The vulnerability is fixed in version 0.8.30.
Markdown Preview Enhanced is a Markdown preview extension for Visual Studio Code. Prior to 0.8.29, Markdown Preview Enhanced evaluates repository-controlled .crossnote/config.js and .crossnote/parser.js files with vm.runInNewContext, which does not provide a security boundary from the Node.js host realm. Opening a Markdown file in a malicious repository automatically loads these files, and prototype-chain traversal can reach the host Function constructor and process object, allowing operating-system commands to execute as the victim account without further interaction. Both configuration evaluation and parser-hook evaluation are affected, and the attack does not depend on module-scoped require being available. This issue is fixed in version 0.8.29.
Markdown Preview Enhanced for Visual Studio Code versions prior to 0.8.28 contains an OS command injection vulnerability. This occurs when a user opens a malicious Markdown file and clicks a crafted external or unsupported-scheme link, causing shell metacharacters to be interpreted by the Windows command shell. This allows execution of arbitrary commands with the privileges of the current user. The vulnerability is fixed in version 0.8.28.
Markdown Preview Enhanced 0.8.x with crossnote engine 0.9.28 contains a code injection vulnerability in the WaveDrom rendering pipeline that allows attackers to execute arbitrary JavaScript by embedding malicious content in a wavedrom fenced code block within a crafted Markdown document. Attackers can exploit the unsanitized passing of wavedrom block content to window.eval() in the VS Code webview context to abuse the extension's message passing and invoke arbitrary file writes on the local filesystem.
Markdown Preview Enhanced before 0.8.28 parses WaveDrom diagrams by evaluating untrusted markdown content with eval(), allowing arbitrary JavaScript execution. The flaw affects every render path - the live preview (window.eval) and presentation mode plus HTML export (the bundled WaveDrom.ProcessAll()/eva() helpers) - and can also be triggered through a <script type="WaveDrom"> element injected via raw HTML in markdown. When a victim previews or exports a crafted markdown document, an attacker can execute arbitrary code, leading to arbitrary file write. Fixed in 0.8.28 by parsing with JSON5.parse() and sanitizing WaveDrom data scripts to inert strict JSON.
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.
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.