{"answers":{"affected":"4 open source packages ship an affected version, including setuptools. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-40897 in the wild and no public exploit code.","fix":"Upgrade setuptools to 65.5.1 or later.","what":"CVE-2022-40897 is a medium-severity denial of service vulnerability in n/a, published on 22 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-40897 and fix it if it is affected.\n\nWhat it is: CVE-2022-40897 is a medium-severity denial of service vulnerability in n/a, published on 22 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-40897 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- setuptools (Bitnami): affected all versions; fixed in 65.5.1\n- setuptools (PyPI): affected all versions; fixed in 65.5.1\n- setuptools (PyPI): affected all versions; fixed in 65.5.1\n- setuptools (PyPI): affected all versions; fixed in 65.5.1\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-2022-40897/ (Markdown: https://insights.sbomify.com/CVE-2022-40897/index.md)","id":"CVE-2022-40897","markdown":"https://insights.sbomify.com/CVE-2022-40897/index.md","name":"CVE-2022-40897","record":{"aliases":["ALSA-2023:0835","ALSA-2023:0952","AZL-60207","BIT-setuptools-2022-40897","CLSA-2026-1774916703","CLSA-2026-1789379973","CLSA-2026-1791500181","CLSA-2026-1791500952","DEBIAN-CVE-2022-40897","GHSA-r9hx-vwmv-q579","MGASA-2023-0219","MINI-4fpq-grg3-6c6c","OESA-2023-1004","PYSEC-2022-43012","RHSA-2023:0835","RHSA-2023:0952","RHSA-2023:7395","RHSA-2024:4421","RLSA-2023:0835","RLSA-2023:0952","ROOT-APP-PYPI-CVE-2022-40897","SUSE-SU-2023:0091-1","SUSE-SU-2023:0093-1","SUSE-SU-2023:0094-1","SUSE-SU-2023:0159-1","SUSE-SU-2023:0202-1","SUSE-SU-2023:0223-1","SUSE-SU-2023:0402-1","SUSE-SU-2023:0403-1","SUSE-SU-2023:4517-1","SUSE-SU-2024:2435-1","UBUNTU-CVE-2022-40897","USN-5817-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Python setuptools library","requires_auth":"none","summary":"Remote attackers can cause denial of service in Python setuptools via crafted HTML in packages or custom PackageIndex pages due to ReDoS.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[{"product":"setuptools","vendor":"python"}],"cvss":{"score":5.9,"severity":"medium","source":"cisa-adp","vector":"CVSS:3.1/AV:N/AC:H/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":"Python Packaging Authority (PyPA) setuptools before 65.5.1 allows remote attackers to cause a denial of service via HTML in a crafted package or custom PackageIndex page. There is a Regular Expression Denial of Service (ReDoS) in package_index.py.","ecosystems":["AlmaLinux:8","AlmaLinux:9","Bitnami","PyPI","Red Hat:enterprise_linux:8::baseos","Red Hat:enterprise_linux:9::baseos","Red Hat:rhel_eus:8.6::baseos","Red Hat:rhel_eus:8.8::appstream","Red Hat:rhel_eus:8.8::crb","Rocky Linux:8","Rocky Linux:9","SUSE:HPE Helion OpenStack 8","SUSE:Linux Enterprise Micro 5.1","SUSE:Linux Enterprise Micro 5.2","SUSE:Linux Enterprise Micro 5.3","SUSE:Linux Enterprise Micro 5.4","SUSE:Linux Enterprise Micro 5.5","SUSE:Linux Enterprise Module for Basesystem 15 SP4","SUSE:Linux Enterprise Module for Basesystem 15 SP5","SUSE:Linux Enterprise Module for Containers 12","SUSE:Linux Enterprise Module for Public Cloud 12","SUSE:Linux Enterprise Module for Python 3 15 SP4","SUSE:Linux Enterprise Real Time 15 SP3","SUSE:Linux Enterprise Server 12 SP5","SUSE:Linux Enterprise Server for SAP Applications 12 SP5","SUSE:Linux Enterprise Software Development Kit 12 SP5","SUSE:OpenStack Cloud 8","SUSE:OpenStack Cloud 9","SUSE:OpenStack Cloud Crowbar 8","SUSE:OpenStack Cloud Crowbar 9","openSUSE:Leap 15.4","openSUSE:Leap 15.5","openSUSE:Leap Micro 5.2","openSUSE:Leap Micro 5.3","openSUSE:Leap Micro 5.4"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"pypa/setuptools vulnerable to Regular Expression Denial of Service (ReDoS)","id":"CVE-2022-40897","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":null,"products":[],"type":"denial_of_service","year":"2022"},"n_packages":172,"n_references":9,"next":{"headline":"pypa/wheel vulnerable to Regular Expression denial of service (ReDoS)","id":"CVE-2022-40898"},"packages":[{"ecosystem":"Bitnami","fixed":["65.5.1"],"introduced":["0"],"last_affected":[],"package":"setuptools","purl":"pkg:bitnami/setuptools","source":"BIT-setuptools-2022-40897"},{"ecosystem":"PyPI","fixed":["65.5.1"],"introduced":["0"],"last_affected":[],"package":"setuptools","purl":null,"source":"GHSA-r9hx-vwmv-q579"},{"ecosystem":"PyPI","fixed":["65.5.1"],"introduced":["0"],"last_affected":[],"package":"setuptools","purl":"pkg:pypi/setuptools","source":"GHSA-r9hx-vwmv-q579"},{"ecosystem":"PyPI","fixed":["65.5.1"],"introduced":["0"],"last_affected":[],"package":"setuptools","purl":"pkg:pypi/setuptools","source":"PYSEC-2022-43012"},{"ecosystem":"AlmaLinux:8","fixed":["39.2.0-6.el8_7.1"],"introduced":["0"],"last_affected":[],"package":"platform-python-setuptools","purl":"pkg:rpm/almalinux/platform-python-setuptools","source":"ALSA-2023:0835"},{"ecosystem":"AlmaLinux:8","fixed":["39.2.0-6.el8_7.1"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools","purl":"pkg:rpm/almalinux/python3-setuptools","source":"ALSA-2023:0835"},{"ecosystem":"AlmaLinux:8","fixed":["39.2.0-6.el8_7.1"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools-wheel","purl":"pkg:rpm/almalinux/python3-setuptools-wheel","source":"ALSA-2023:0835"},{"ecosystem":"AlmaLinux:9","fixed":["53.0.0-10.el9_1.1"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools","purl":"pkg:rpm/almalinux/python3-setuptools","source":"ALSA-2023:0952"},{"ecosystem":"AlmaLinux:9","fixed":["53.0.0-10.el9_1.1"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools-wheel","purl":"pkg:rpm/almalinux/python3-setuptools-wheel","source":"ALSA-2023:0952"},{"ecosystem":"Red Hat:enterprise_linux:8::baseos","fixed":["0:39.2.0-6.el8_7.1"],"introduced":["0"],"last_affected":[],"package":"platform-python-setuptools","purl":"pkg:rpm/redhat/platform-python-setuptools","source":"RHSA-2023:0835"},{"ecosystem":"Red Hat:enterprise_linux:8::baseos","fixed":["0:39.2.0-6.el8_7.1"],"introduced":["0"],"last_affected":[],"package":"python-setuptools","purl":"pkg:rpm/redhat/python-setuptools","source":"RHSA-2023:0835"},{"ecosystem":"Red Hat:enterprise_linux:8::baseos","fixed":["0:39.2.0-6.el8_7.1"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools","purl":"pkg:rpm/redhat/python3-setuptools","source":"RHSA-2023:0835"},{"ecosystem":"Red Hat:enterprise_linux:8::baseos","fixed":["0:39.2.0-6.el8_7.1"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools-wheel","purl":"pkg:rpm/redhat/python3-setuptools-wheel","source":"RHSA-2023:0835"},{"ecosystem":"Red Hat:enterprise_linux:9::baseos","fixed":["0:53.0.0-10.el9_1.1"],"introduced":["0"],"last_affected":[],"package":"python-setuptools","purl":"pkg:rpm/redhat/python-setuptools","source":"RHSA-2023:0952"},{"ecosystem":"Red Hat:enterprise_linux:9::baseos","fixed":["0:53.0.0-10.el9_1.1"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools","purl":"pkg:rpm/redhat/python3-setuptools","source":"RHSA-2023:0952"},{"ecosystem":"Red Hat:enterprise_linux:9::baseos","fixed":["0:53.0.0-10.el9_1.1"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools-wheel","purl":"pkg:rpm/redhat/python3-setuptools-wheel","source":"RHSA-2023:0952"},{"ecosystem":"Red Hat:rhel_eus:8.6::baseos","fixed":["0:39.2.0-7.el8_6"],"introduced":["0"],"last_affected":[],"package":"platform-python-setuptools","purl":"pkg:rpm/redhat/platform-python-setuptools","source":"RHSA-2023:7395"},{"ecosystem":"Red Hat:rhel_eus:8.6::baseos","fixed":["0:39.2.0-7.el8_6"],"introduced":["0"],"last_affected":[],"package":"python-setuptools","purl":"pkg:rpm/redhat/python-setuptools","source":"RHSA-2023:7395"},{"ecosystem":"Red Hat:rhel_eus:8.6::baseos","fixed":["0:39.2.0-7.el8_6"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools","purl":"pkg:rpm/redhat/python3-setuptools","source":"RHSA-2023:7395"},{"ecosystem":"Red Hat:rhel_eus:8.6::baseos","fixed":["0:39.2.0-7.el8_6"],"introduced":["0"],"last_affected":[],"package":"python3-setuptools-wheel","purl":"pkg:rpm/redhat/python3-setuptools-wheel","source":"RHSA-2023:7395"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:5.4.1-1.module+el8.5.0+10613+59a13ec4"],"introduced":["0"],"last_affected":[],"package":"PyYAML","purl":"pkg:rpm/redhat/PyYAML","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:5.4.1-1.module+el8.5.0+10613+59a13ec4"],"introduced":["0"],"last_affected":[],"package":"PyYAML-debugsource","purl":"pkg:rpm/redhat/PyYAML-debugsource","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:4.7.1-5.module+el8.7.0+16654+645aad7f"],"introduced":["0"],"last_affected":[],"package":"mod_wsgi","purl":"pkg:rpm/redhat/mod_wsgi","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:1.19.4-3.module+el8.5.0+12204+54860423"],"introduced":["0"],"last_affected":[],"package":"numpy","purl":"pkg:rpm/redhat/numpy","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:1.19.4-3.module+el8.5.0+12204+54860423"],"introduced":["0"],"last_affected":[],"package":"numpy-debugsource","purl":"pkg:rpm/redhat/numpy-debugsource","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:0.10.1-2.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-PyMySQL","purl":"pkg:rpm/redhat/python-PyMySQL","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:1.14.3-2.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-cffi","purl":"pkg:rpm/redhat/python-cffi","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:1.14.3-2.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-cffi-debugsource","purl":"pkg:rpm/redhat/python-cffi-debugsource","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:3.0.4-19.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-chardet","purl":"pkg:rpm/redhat/python-chardet","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:3.3.1-2.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-cryptography","purl":"pkg:rpm/redhat/python-cryptography","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:3.3.1-2.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-cryptography-debugsource","purl":"pkg:rpm/redhat/python-cryptography-debugsource","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:2.10-3.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-idna","purl":"pkg:rpm/redhat/python-idna","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:4.6.5-1.module+el8.6.0+13933+9cf0c87c"],"introduced":["0"],"last_affected":[],"package":"python-lxml","purl":"pkg:rpm/redhat/python-lxml","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:4.6.5-1.module+el8.6.0+13933+9cf0c87c"],"introduced":["0"],"last_affected":[],"package":"python-lxml-debugsource","purl":"pkg:rpm/redhat/python-lxml-debugsource","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:3.11-10.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-ply","purl":"pkg:rpm/redhat/python-ply","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:5.8.0-4.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-psutil","purl":"pkg:rpm/redhat/python-psutil","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:5.8.0-4.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-psutil-debugsource","purl":"pkg:rpm/redhat/python-psutil-debugsource","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:2.8.6-2.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-psycopg2","purl":"pkg:rpm/redhat/python-psycopg2","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:2.8.6-2.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-psycopg2-debugsource","purl":"pkg:rpm/redhat/python-psycopg2-debugsource","source":"RHSA-2024:4421"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:2.20-3.module+el8.4.0+9822+20bf1249"],"introduced":["0"],"last_affected":[],"package":"python-pycparser","purl":"pkg:rpm/redhat/python-pycparser","source":"RHSA-2024:4421"}],"prev":{"headline":"Pygments vulnerable to ReDoS","id":"CVE-2022-40896"},"products":["n/a"],"published":"2022-12-22","related":[{"cvss_score":6.8,"headline":"Setuptools vulnerable to Man-in-the-middle attacks","id":"CVE-2013-1633","kev_date_added":null,"published":"2013-08-06"},{"cvss_score":6.1,"headline":"setuptools: MANIFEST.in exclusion bypass in sdist via Unicode normalization collision (NFC/NFD) on macOS APFS/HFS+","id":"CVE-2026-59890","kev_date_added":null,"published":"2026-07-08"}],"sources":[{"class":"attribution","licence":"MIT","name":"AlmaLinux","prefix":"ALSA"},{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"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":"Red Hat","prefix":"RHSA"},{"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":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-11-04","vendors":["n/a"]},"summary":"Remote attackers can cause denial of service in Python setuptools via crafted HTML in packages or custom PackageIndex pages due to ReDoS.","url":"https://insights.sbomify.com/CVE-2022-40897/"}