Skip to content

Image: storage.ghost.io · rights & removal

Executive Summary

A popular VS Code extension, Markdown Preview Enhanced, was audited and found to have five security vulnerabilities across two attack surfaces stemming from its auto-update mechanism. One vulnerability involved a WaveDrom rendering bug that allowed attacker-controlled JavaScript execution within the preview, which could lead to arbitrary file write on disk. This chain involved execution inside the preview, webview-to-extension messaging, and an unconstrained file write function. Further auditing revealed two additional vulnerabilities related to workspace configuration files allowing code execution, and weaknesses in the shared infrastructure responsible for command dispatch and file writing. All five identified vulnerabilities were subsequently fixed across versions v0.8.28 through v0.8.30.

Facts Only

* Markdown Preview Enhanced had approximately 9.5 million installs.
* Five CVEs were found across two attack surfaces.
* A WaveDrom rendering bug allowed JavaScript execution inside the preview, leading to arbitrary file write on disk (CVE-2026-50733).
* A VM sandbox escape in workspace configuration files allowed direct OS command execution (CVE-2026-54566).
* An unsanitized HTML injection provided a second XSS entry point (CVE-2026-54701).
* The webview-to-host messaging channel and file write mechanism had associated vulnerabilities (CVE-2026-54702, CVE-2026-54703).
* These five issues were all fixed in versions v0.8.28 through v0.8.30.
* Arbitrary code execution was demonstrated via loading files from workspace configuration settings.
* The file write operation accepted any file:// URI and content without containment checks.

Full Take

The vulnerability chain demonstrates how seemingly benign features within developer tooling, particularly those involving rich preview surfaces, can become critical supply-chain vectors. The core finding is that a flaw in rendering a specific data format (WaveDrom) within a webview created an exploitable bridge across security boundaries: from user input (Markdown file) to client-side execution, to inter-process communication via messaging, and finally to host-level system calls via unvalidated API commands or file writing. This structure reveals that the risk is not isolated to a single bug but emerges from the interaction between multiple components—rendering engines, message dispatchers, and file system access routines. The failure of client-side sanitization layers to account for data flowing through complex channels like `postMessage` suggests a systemic gap in trusting inter-process communication. Furthermore, the successful exploitation via workspace configuration files highlights that sandbox boundaries are not absolute when shared libraries or host mechanisms, such as Node's V8 context evaluation, are leveraged. The defense ultimately required shifting from relying on superficial input filtering to enforcing strict isolation—utilizing WASM engines for execution and implementing explicit, restrictive allowlists for all cross-boundary interactions like command dispatch and file operations.
BRIDGE QUESTIONS: What other assumed trust relationships exist between IDE extensions, webviews, and the host operating system that are not explicitly modeled by modern sandboxing techniques? How can development ecosystems be structured to enforce least privilege across components that inherently share runtime environments? What is the necessary threshold of scrutiny for features involving rich rendering or external data loading within developer tools to prevent latent systemic risk?

From the original · ProjectDiscovery Blog

Install VS Code Extension Your code editor extensions auto-update and run with your privileges on the machine that holds your source code, your SSH keys, and your publishing credentials, but they rarely show up in a software bill of materials. Using Neo we audited one of the most popular ones, Markdown Preview Enhanced has roughly 9.5 million installs.
Read the full story at projectdiscovery.io

Sentinel — provisional

Raw score, 0 to 1 (uncalibrated)0.15

No strong signs of machine writing were found in the source article. Provisional estimate, not a finding that a person wrote it.

The model's own note (unverified)

This text reads like a forensic security audit detailing a specific vulnerability chain in software development tools, structured methodically around technical facts and resulting defensive strategies.

This looks only at the wording of the original source article, not at this page's AI-written sections. A small local AI model made this estimate. It has not been checked against known human and machine texts, so treat it as provisional. It cannot show who wrote an article.

What the model noticed in the source article
low severity: Varied sentence length and specific, technical pacing.
low severity: Deep, focused progression from a specific bug chain to broad supply-chain implications with strong internal consistency.
low severity: Highly structured presentation of technical details (CVEs, code snippets) that align perfectly with the narrative flow.
low severity: Specific CVE numbers, version numbers, and detailed vulnerability descriptions suggest direct forensic analysis rather than generalized synthesis.
Signs the model read as against machine writing
The specific enumeration of complex technical details (CVEs, specific code manipulation paths) and the layered defensive recommendations strongly suggest an expert-driven audit report.
The concluding section offering actionable, synthesized rules ('Treat rendered content as hostile input,' 'Never eval') reflects a human analyst distilling complex findings into principles.
Supply Chain Security Analysis of a 9.5M | Huntaegis