CodeMirror Markdown Mode Regular Expression Denial-of-Service Vulnerability

Vulnerability

A denial-of-service vulnerability has been identified in CodeMirror versions through 5.17.0, specifically within the Markdown mode component. The issue arises from certain regular expressions that exhibit inefficient complexity, allowing specially crafted input to cause catastrophic backtracking. This exploitation can freeze the application or significantly degrade performance. The vulnerability can be triggered remotely in both browser and server-side environments that use CodeMirror's Markdown mode.

Impact

Exploitation of this vulnerability leads to a regular-expression denial-of-service (ReDoS), causing the application to freeze or severely slow down.

Reproduction

The vulnerability can be reproduced by using CodeMirror in Markdown mode and inputting carefully crafted strings that exploit the vulnerable regular expressions. This can be done either through a standalone HTML file that includes CodeMirror and its Markdown mode, or by adding a test case to an existing CodeMirror test suite that checks for performance issues with the same payloads.

Added: Jun 22, 2025, 10:19 PM
Updated: Jun 22, 2025, 10:19 PM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
2.5
exploitability
6.0
remediation
0.0
relevance
0.2
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.