CVE-2022-34749: Mistune vulnerable to catastrophic backtracking
8.6
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.2714%
CWE
Published
7/26/2022
Updated
9/25/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| mistune | pip | >= 2.0.0a1, < 2.0.3 | 2.0.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the ASTERISK_EMPHASIS regex pattern in inline_parser.py. The commit diff shows this regex was modified to prevent catastrophic backtracking by replacing the vulnerable '(?:\[\]|[^])' pattern with a more efficient '(?:(?:(?<!\)(?:\\)*)|[^*])+' and adding a negative lookbehind assertion. The removed test cases in non-commonmark.txt specifically tested these edge cases of nested emphasis markers, confirming this was the attack vector. The CWE-1333 classification and commit message explicitly reference this regex as the fix target.