CVE-2026-50733: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') in shd101wyy Markdown Preview Enhanced
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.
AI Analysis
Technical Summary
Markdown Preview Enhanced versions prior to 0.8.28 parse WaveDrom diagrams by evaluating untrusted markdown content with JavaScript eval(), enabling arbitrary code execution. This vulnerability affects multiple rendering paths including live preview (window.eval), presentation mode, and HTML export via bundled WaveDrom helpers. Attackers can inject malicious <script type="WaveDrom"> elements through raw HTML in markdown, triggering arbitrary JavaScript execution and arbitrary file writes upon rendering. The vulnerability is addressed in version 0.8.28 by switching to JSON5.parse() for parsing and sanitizing WaveDrom scripts to inert strict JSON, eliminating the use of eval().
Potential Impact
Successful exploitation allows an attacker to execute arbitrary JavaScript code in the context of the Markdown Preview Enhanced application without privileges or user interaction beyond previewing or exporting a crafted markdown document. This can lead to arbitrary file writes and potentially other malicious actions within the user's environment. The CVSS 4.0 base score is 8.6 (high), reflecting network attack vector, low attack complexity, no privileges required, user interaction needed, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
A fix is available in Markdown Preview Enhanced version 0.8.28, which replaces the unsafe eval()-based parsing with JSON5.parse() and sanitizes WaveDrom data scripts. Users should upgrade to version 0.8.28 or later to remediate this vulnerability. Since no vendor advisory is provided, users should verify the update from official sources. Until upgraded, avoid previewing or exporting untrusted markdown documents containing WaveDrom diagrams.
CVE-2026-50733: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') in shd101wyy Markdown Preview Enhanced
Description
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.
CVSS v4.0
Score 8.6high
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Markdown Preview Enhanced versions prior to 0.8.28 parse WaveDrom diagrams by evaluating untrusted markdown content with JavaScript eval(), enabling arbitrary code execution. This vulnerability affects multiple rendering paths including live preview (window.eval), presentation mode, and HTML export via bundled WaveDrom helpers. Attackers can inject malicious <script type="WaveDrom"> elements through raw HTML in markdown, triggering arbitrary JavaScript execution and arbitrary file writes upon rendering. The vulnerability is addressed in version 0.8.28 by switching to JSON5.parse() for parsing and sanitizing WaveDrom scripts to inert strict JSON, eliminating the use of eval().
Potential Impact
Successful exploitation allows an attacker to execute arbitrary JavaScript code in the context of the Markdown Preview Enhanced application without privileges or user interaction beyond previewing or exporting a crafted markdown document. This can lead to arbitrary file writes and potentially other malicious actions within the user's environment. The CVSS 4.0 base score is 8.6 (high), reflecting network attack vector, low attack complexity, no privileges required, user interaction needed, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
A fix is available in Markdown Preview Enhanced version 0.8.28, which replaces the unsafe eval()-based parsing with JSON5.parse() and sanitizes WaveDrom data scripts. Users should upgrade to version 0.8.28 or later to remediate this vulnerability. Since no vendor advisory is provided, users should verify the update from official sources. Until upgraded, avoid previewing or exporting untrusted markdown documents containing WaveDrom diagrams.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-06-05T16:54:32.159Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a23130ee29bf47b50a3f1f2
Added to database: 6/5/2026, 6:18:54 PM
Last enriched: 6/5/2026, 6:33:26 PM
Last updated: 6/5/2026, 7:46:37 PM
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.