MarkText Regular Expression Denial-of-Service Vulnerability

Vulnerability

A denial-of-service vulnerability has been identified in MarkText versions through 0.17.1. The issue arises in the function 'getRecommendTitleFromMarkdownString' within 'marktext/src/main/utils/index.js', where an inefficient regular expression can be exploited to cause excessive CPU usage, potentially leading to application freezing or a denial-of-service condition. This vulnerability can be triggered remotely without authentication, by embedding maliciously crafted code blocks into the parsed Markdown, which the regular expression fails to process efficiently.

Impact

Exploitation of this vulnerability causes a regular expression denial-of-service, where the application experiences significantly increased CPU usage, leading to performance degradation or unresponsiveness.

Reproduction

The vulnerability can be reproduced by cloning the MarkText repository, checking out the 'develop' branch, and running the unit tests. The specific test case that triggers the vulnerability is located in the 'match-electron-accelerator.spec.js' file, within the 'unit/specs' directory. This test case includes the necessary input to exploit the regular expression inefficiency.

Remediation

No known mitigation is available for this vulnerability.

Added: Jun 22, 2025, 8:21 PM
Updated: Jun 22, 2025, 8:21 PM

Vulnerability Rating

Custom Algorithm
spread
5.4
impact
2.5
exploitability
5.8
remediation
0.0
relevance
0.2
threat
6.4
urgency
2.9
incentive
0.8

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