CVE-2022-34749: Mistune Mistune Vulnerable To Catastrophic Backtracking Vulnerability
HIGHCVE-2022-34749 is a HIGH (CVSS 8.6) mistune vulnerable to catastrophic backtracking vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Mistune libraries in the PyPI ecosystem. The issue involves mistune vulnerable to catastrophic backtracking. Remediation is available by upgrading affected packages to version 2.0.3.
CVE-2022-34749 at a Glance
Security Impact
CVSS: 8.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H).
How to Fix CVE-2022-34749
To remediate this vulnerability, upgrade all affected Mistune dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install mistune>=2.0.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show mistune
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-34749, inspect your installed packages using pip:
pip show mistune
Analyze the terminal output to locate any version of Mistune in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.3), your application is affected.
Note: The pip show mistune command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Mistune, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-34749 Affected Mistune Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mistune
|
PyPI |
≥ 2.0.0a1
< 2.0.3
|
2.0.3
|
References
Frequently Asked Questions
What is CVE-2022-34749?
Which Mistune versions are affected?
What version fixes CVE-2022-34749?
Is mistune affected?
What is the CVSS score of CVE-2022-34749?
What CWE is associated with CVE-2022-34749?
How can I check PyPI dependencies for CVE-2022-34749?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fw3v-x4f2-v673",
"modified" : "2024-09-25T20:07:25Z",
"published" : "2022-07-26T00:00:27Z",
"aliases" : [ "CVE-2022-34749" ],
"summary" : "Mistune vulnerable to catastrophic backtracking",
"details" : "In Mistune through 2.0.2, support of inline markup is implemented by using regular expressions that can involve a high amount of backtracking on certain edge cases. This behavior is commonly named catastrophic backtracking.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "mistune"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0a1"
}, {
"fixed" : "2.0.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-34749"
}, {
"type" : "WEB",
"url" : "https://github.com/lepture/mistune/issues/314#issuecomment-1223972386"
}, {
"type" : "WEB",
"url" : "https://github.com/lepture/mistune/commit/a6d43215132fe4f3d93f8d7e90ba83b16a0838b2"
}, {
"type" : "WEB",
"url" : "https://github.com/lepture/mistune/commit/ca1e7b506850f4e488823fc7338b49a8f9852718"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/lepture/mistune"
}, {
"type" : "WEB",
"url" : "https://github.com/lepture/mistune/releases"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/mistune/PYSEC-2022-237.yaml"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TQHXITQ2DSBYOILKHXBSBB7PFBPZHF63"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-07-29T22:24:56Z",
"nvd_published_at" : "2022-07-25T23:15:00Z"
}
}