Inefficient Regular Expression Complexity Affecting python-mechanize package, versions <1:0.4.5-2ubuntu0.1~esm1


Severity

Recommended
medium

Based on Ubuntu security rating.

Threat Intelligence

EPSS
28.66% (99th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UBUNTU2004-PYTHONMECHANIZE-3236438
  • published15 Nov 2026
  • disclosed17 Jan 2023

Introduced: 17 Jan 2023

CVE-2021-32837  (opens in a new tab)
CWE-1333  (opens in a new tab)

How to fix?

Upgrade Ubuntu:20.04 python-mechanize to version 1:0.4.5-2ubuntu0.1~esm1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream python-mechanize package and not the python-mechanize package as distributed by Ubuntu. See How to fix? for Ubuntu:20.04 relevant fixed versions and status.

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.

CVSS Base Scores

version 3.1