{"answers":{"affected":"3 open source packages ship an affected version, including mechanize. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-32837 exists.","fix":"Upgrade mechanize to 0.4.6 or later.","what":"CVE-2021-32837 is a high-severity denial of service vulnerability in python-mechanize mechanize, published on 17 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-32837 and fix it if it is affected.\n\nWhat it is: CVE-2021-32837 is a high-severity denial of service vulnerability in python-mechanize mechanize, published on 17 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-32837 exists.\n\nAffected packages and fixed versions:\n- mechanize (PyPI): affected all versions; fixed in 0.4.6\n- mechanize (PyPI): affected all versions; fixed in 0.4.6\n- mechanize (PyPI): affected all versions; fixed in 0.4.6\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-32837/ (Markdown: https://insights.sbomify.com/CVE-2021-32837/index.md)","id":"CVE-2021-32837","markdown":"https://insights.sbomify.com/CVE-2021-32837/index.md","name":"CVE-2021-32837","record":{"aliases":["DEBIAN-CVE-2021-32837","DLA-3460-1","DLA-4418-1","GHSA-g3pv-pj5f-3hfq","MGASA-2023-0036","PYSEC-2023-25","UBUNTU-CVE-2021-32837","openSUSE-SU-2023:0030-1","openSUSE-SU-2024:12621-1","openSUSE-SU-2025:15098-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Python HTTP library","requires_auth":"none","summary":"A malicious web server can cause the mechanize library to crash via a regular expression denial of service attack.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"mechanize","vendor":"mechanize_project"}],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","version":"3.1"},"cwes":[{"id":"CWE-1333","name":"Inefficient Regular Expression Complexity"}],"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.","ecosystems":["PyPI","SUSE:Package Hub 15 SP4","openSUSE:Leap 15.4","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"mechanize vulnerable to ReDoS","id":"CVE-2021-32837","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"denial_of_service","year":"2021"},"n_packages":6,"n_references":5,"next":{"headline":"Regular Expression Denial of Service in flask-restx","id":"CVE-2021-32838"},"packages":[{"ecosystem":"PyPI","fixed":["0.4.6"],"introduced":["0"],"last_affected":[],"package":"mechanize","purl":null,"source":"GHSA-g3pv-pj5f-3hfq"},{"ecosystem":"PyPI","fixed":["0.4.6"],"introduced":["0"],"last_affected":[],"package":"mechanize","purl":"pkg:pypi/mechanize","source":"GHSA-g3pv-pj5f-3hfq"},{"ecosystem":"PyPI","fixed":["0.4.6"],"introduced":["0"],"last_affected":[],"package":"mechanize","purl":"pkg:pypi/mechanize","source":"PYSEC-2023-25"},{"ecosystem":"SUSE:Package Hub 15 SP4","fixed":["0.4.8-bp154.2.3.1"],"introduced":["0"],"last_affected":[],"package":"python-mechanize","purl":"pkg:rpm/suse/python-mechanize\u0026distro=SUSE%20Package%20Hub%2015%20SP4","source":"openSUSE-SU-2023:0030-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["0.4.8-bp154.2.3.1"],"introduced":["0"],"last_affected":[],"package":"python-mechanize","purl":"pkg:rpm/opensuse/python-mechanize\u0026distro=openSUSE%20Leap%2015.4","source":"openSUSE-SU-2023:0030-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["0.4.10-1.4"],"introduced":["0"],"last_affected":[],"package":"python-mechanize","purl":"pkg:rpm/opensuse/python-mechanize\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2025:15098-1"}],"prev":{"headline":"Pre-auth unsafe deserialization in ZStack","id":"CVE-2021-32836"},"products":["mechanize"],"published":"2023-01-17","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-12-22","vendors":["python-mechanize"]},"summary":"A malicious web server can cause the mechanize library to crash via a regular expression denial of service attack.","url":"https://insights.sbomify.com/CVE-2021-32837/"}