Markdown-it Cross-Site Scripting Vulnerability

Vulnerability

A cross-site scripting (XSS) vulnerability has been identified in the Markdown-it library, specifically in version 14.1.0. The issue arises in the fenced code block rendering functionality, where improper input sanitization allows for the execution of arbitrary JavaScript. This vulnerability is located in the file 'lib/renderer.mjs'.

Impact

Exploitation of this vulnerability allows for reflected cross-site scripting, where an attacker can inject malicious JavaScript that is executed in the context of the user's browser.

Reproduction

To reproduce this vulnerability, install Markdown-it version 14.1.0 and set up a server using Express.js. Create a test HTML file that triggers the vulnerability by sending a POST request to the '/api/render' endpoint with markdown content that includes a fenced code block. The injected JavaScript will be executed when the rendered markdown is viewed in a browser.

Added: Aug 21, 2025, 5:21 PM
Updated: Aug 21, 2025, 6:25 PM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
1.7
exploitability
5.8
remediation
0.0
relevance
0.4
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.