CVE-2021-32837
JSON

7.5high

mechanize vulnerable to ReDoS

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
28.7% (higher than 98% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-g3pv-pj5f-3hfqPYSEC-2023-25

Description

mechanize, a library for automatically interacting with HTTP web servers, contains a regular expression that is vulnerable to regular expression denial of service (ReDoS) prior to version 0.4.6. If a web server responds in a malicious way, then mechanize could crash. Version 0.4.6 has a patch for the issue.

Affected

Product or packageVersionsReported by
python-mechanize mechanizefrom 0.4.6 before 0.4.6CVE List
mechanize (PyPI)before 0.4.6, before dd05334448e9f39814bab044d2eaa5ef69b410d6GitHub Advisory Database, PyPA Advisory Database
mechanize_project mechanizebefore 0.4.6NVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-1333

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

mechanize, a library for automatically interacting with HTTP web servers, contains a regular expression that is vulnerable to regular expression denial of service (ReDoS) prior to version 0.4.6. If a web server responds in a malicious way, then mechanize could crash. Version 0.4.6 has a patch for the issue.

NVD (es)

mechanize, una librería para interactuar automáticamente con servidores web HTTP, contiene una expresión regular que es vulnerable a la denegación de servicio de expresión regular (ReDoS) antes de la versión 0.4.6. Si un servidor web responde de forma maliciosa, mechanize podría fallar. La versión 0.4.6 tiene un parche para este problema.

References

https://securitylab.github.com/advisories/GHSL-2021-108-python-mechanize-mechanize/advisory, evidence, exploit, third-party-advisory
https://github.com/python-mechanize/mechanize/blob/3acb1836f3fd8edc5a758a417dd46b53832ae3b5/mechanize/_urllib2_fork.py#L878-L879evidence, exploit, third-party-advisory, web
https://github.com/python-mechanize/mechanize/releases/tag/v0.4.6third-party-advisory, web
https://github.com/python-mechanize/mechanize/commit/dd05334448e9f39814bab044d2eaa5ef69b410d6fix, patch, third-party-advisory, web
https://lists.debian.org/debian-lts-announce/2023/06/msg00022.htmlmailing-list, web
https://lists.debian.org/debian-lts-announce/2025/12/msg00028.htmlweb
https://nvd.nist.gov/vuln/detail/CVE-2021-32837advisory
https://github.com/pypa/advisory-database/tree/main/vulns/mechanize/PYSEC-2023-25.yamlweb
https://github.com/python-mechanize/mechanizepackage
https://securitylab.github.com/advisories/GHSL-2021-108-python-mechanize-mechanizeadvisory
https://github.com/advisories/GHSA-g3pv-pj5f-3hfqadvisory

Sources

SourceRecordLicence
CVE ListCVE-2021-32837 changed 2025-12-22CVE Terms of Use
GitHub Advisory DatabaseGHSA-g3pv-pj5f-3hfq changed 2025-12-22CC-BY-4.0
NVDCVE-2021-32837 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2023-25 changed 2026-06-10CC-BY-4.0