CVE-2026-49493: Improper Control of Generation of Code ('Code Injection') in shd101wyy Markdown Preview Enhanced
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.
AI Analysis
Technical Summary
Markdown Preview Enhanced before version 0.8.28 improperly controls code generation when parsing Bitfield fenced code blocks. It uses interpretJS() that executes the block content as JavaScript code in a new VM context, enabling an attacker to execute arbitrary code on the server when rendering or exporting a crafted markdown document containing a malicious bitfield code block. The vulnerability is addressed in version 0.8.28 by switching to JSON5.parse() for parsing bitfield register definitions, eliminating code execution and restricting parsing to data only.
Potential Impact
An attacker can achieve arbitrary code execution on the server by supplying a malicious markdown document with a crafted bitfield code block. This can lead to full compromise of the server environment where the markdown is rendered or exported. The vulnerability has a high CVSS 4.0 score of 8.6, indicating significant impact with network attack vector, no privileges required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade Markdown Preview Enhanced to version 0.8.28 or later, where the vulnerability is fixed by replacing the unsafe code evaluation with safe JSON5 parsing. No other mitigations are indicated or recommended by the vendor advisory. Patch status is not explicitly stated but the fix is included in version 0.8.28.
CVE-2026-49493: Improper Control of Generation of Code ('Code Injection') in shd101wyy Markdown Preview Enhanced
Description
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.
CVSS v4.0
Score 8.6high
Affected software
pkg:npm/shd101wyy/markdown-preview-enhancedRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Markdown Preview Enhanced before version 0.8.28 improperly controls code generation when parsing Bitfield fenced code blocks. It uses interpretJS() that executes the block content as JavaScript code in a new VM context, enabling an attacker to execute arbitrary code on the server when rendering or exporting a crafted markdown document containing a malicious bitfield code block. The vulnerability is addressed in version 0.8.28 by switching to JSON5.parse() for parsing bitfield register definitions, eliminating code execution and restricting parsing to data only.
Potential Impact
An attacker can achieve arbitrary code execution on the server by supplying a malicious markdown document with a crafted bitfield code block. This can lead to full compromise of the server environment where the markdown is rendered or exported. The vulnerability has a high CVSS 4.0 score of 8.6, indicating significant impact with network attack vector, no privileges required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade Markdown Preview Enhanced to version 0.8.28 or later, where the vulnerability is fixed by replacing the unsafe code evaluation with safe JSON5 parsing. No other mitigations are indicated or recommended by the vendor advisory. Patch status is not explicitly stated but the fix is included in version 0.8.28.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-05-31T11:54:34.993Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a23130ee29bf47b50a3f1ee
Added to database: 06/05/2026, 18:18:54 UTC
Last enriched: 06/13/2026, 09:34:10 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 85
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.