cve.bz

CVE-2022-40897 python setuptools

5.9 mediumExploit referenceEPSS 2.6%Fix available

Medium (5.9) in python setuptools. EPSS 2.6% estimated probability of exploitation activity in the next 30 days. Fixed in setuptools 65.5.1.

On this page
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.

Severity

CVSS 3.1

5.9 medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
2.6% (unchanged from 2.6% a week ago; 2.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 86th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-07-16. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-1333 Inefficient Regular Expression Complexity
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-40897 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-40897?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-40897?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-40897 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
python:setuptoolsbefore 65.5.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-r9hx-vwmv-q579PyPIsetuptools<65.5.165.5.1
PYSEC-2022-43012PyPIsetuptools<65.5.165.5.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11setuptools52.0.0-4+deb11u1DLA-3876-1
Debian12, 13, 14setuptools65.6.3-1DEBIAN-CVE-2022-40897
Ubuntu18.04:LTSpython-pip9.0.1-2.3~ubuntu1.18.04.6UBUNTU-CVE-2022-40897
Ubuntu18.04:LTSpython-setuptools39.0.1-2ubuntu0.1UBUNTU-CVE-2022-40897 USN-5817-1
Ubuntu20.04:LTSpython-pip20.0.2-5ubuntu1.7UBUNTU-CVE-2022-40897
Ubuntu20.04:LTSpython-setuptools44.0.0-2ubuntu0.1UBUNTU-CVE-2022-40897 USN-5817-1
Ubuntu20.04:LTSsetuptools45.2.0-1ubuntu0.1UBUNTU-CVE-2022-40897 USN-5817-1
Ubuntu22.04:LTSpython-pip22.0.2+dfsg-1ubuntu0.1UBUNTU-CVE-2022-40897
Ubuntu22.04:LTSpython-setuptools44.1.1-1.2ubuntu0.22.04.1UBUNTU-CVE-2022-40897 USN-5817-1
Ubuntu22.04:LTSsetuptools59.6.0-1.2ubuntu0.22.04.1UBUNTU-CVE-2022-40897 USN-5817-1
UbuntuPro:14.04:LTSpython-pip1.5.4-1ubuntu4+esm2UBUNTU-CVE-2022-40897
UbuntuPro:14.04:LTSpython-setuptools3.3-1ubuntu2+esm1UBUNTU-CVE-2022-40897 USN-5817-1
UbuntuPro:16.04:LTSpython-pip8.1.1-2ubuntu0.6+esm3UBUNTU-CVE-2022-40897
UbuntuPro:16.04:LTSpython-setuptools20.7.0-1ubuntu0.1~esm1UBUNTU-CVE-2022-40897 USN-5817-1
Red Hatenterprise_linux:8::appstreamCython, python2-Cython, Cython-debugsource and 1 more0:0.28.1-7.module+el8.9.0+19487+7dc18407RHSA-2024:2987
Red Hatenterprise_linux:8::appstreamPyYAML, python2-pyyaml, PyYAML-debugsource and 1 more0:3.12-16.module+el8.9.0+19487+7dc18407RHSA-2024:2987
Red Hatenterprise_linux:8::appstreamPyYAML, python39-pyyaml, PyYAML-debugsource and 1 more0:5.4.1-1.module+el8.9.0+19644+d68f775dRHSA-2024:2985
Red Hatenterprise_linux:8::appstreambabel, python2-babel0:2.5.1-10.module+el8.9.0+19487+7dc18407RHSA-2024:2987
Red Hatenterprise_linux:8::appstreammod_wsgi, python39-mod_wsgi0:4.7.1-7.module+el8.9.0+19644+d68f775dRHSA-2024:2985
Red Hatenterprise_linux:8::appstreamnumpy, python2-numpy, numpy-debugsource and 3 more1:1.14.2-16.module+el8.9.0+19487+7dc18407RHSA-2024:2987
Red Hatenterprise_linux:8::appstreamnumpy, python39-numpy, numpy-debugsource and 3 more0:1.19.4-3.module+el8.9.0+19644+d68f775dRHSA-2024:2985
Red Hatenterprise_linux:8::appstreampytest, python2-pytest0:3.4.2-13.module+el8.9.0+19487+7dc18407RHSA-2024:2987
Red Hatenterprise_linux:8::appstreampython-PyMySQL, python2-PyMySQL0:0.8.0-10.module+el8.9.0+19487+7dc18407RHSA-2024:2987
Red Hatenterprise_linux:8::appstreampython-PyMySQL, python39-PyMySQL0:0.10.1-2.module+el8.9.0+19644+d68f775dRHSA-2024:2985
Red Hatenterprise_linux:8::appstreampython-attrs, python2-attrs0:17.4.0-10.module+el8.9.0+19487+7dc18407RHSA-2024:2987
Red Hatenterprise_linux:8::appstreampython-backports, python2-backports0:1.0-16.module+el8.9.0+18326+1b5baeeeRHSA-2024:2987
132 more for Red Hat in the JSON and on Red Hat's page.
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8python-setuptools36.5.0-3.3.1SUSE-SU-2023:0403-1
SUSELinux Enterprise Micro 5.1, Linux Enterprise Micro 5.2python-setuptools40.5.0-150100.6.6.1SUSE-SU-2023:0223-1
SUSELinux Enterprise Micro 5.3python-setuptools44.1.1-150400.3.3.1SUSE-SU-2023:0159-1
SUSELinux Enterprise Micro 5.3, Linux Enterprise Micro 5.4, Linux Enterprise Micro 5.5python3-setuptools44.1.1-150400.9.6.1SUSE-SU-2023:4517-1
SUSELinux Enterprise Micro 5.5python3-setuptools44.1.1-150400.9.6.1SUSE-SU-2024:2435-1
SUSELinux Enterprise Module for Basesystem 15 SP4python-setuptools, python-setuptools-test, python-setuptools-wheel44.1.1-150400.3.3.1SUSE-SU-2023:0159-1
SUSELinux Enterprise Module for Basesystem 15 SP4, Linux Enterprise Module for Basesystem 15 SP5python3-setuptools, python3-setuptools-test, python3-setuptools-wheel44.1.1-150400.9.6.1SUSE-SU-2023:4517-1
SUSELinux Enterprise Module for Containers 12, Linux Enterprise Module for Public Cloud 12, Linux Enterprise Server 12 SP5 and 2 morepython-setuptools40.6.2-4.21.1SUSE-SU-2023:0093-1
SUSELinux Enterprise Module for Python 3 15 SP4python310-setuptools57.4.0-150400.4.3.1SUSE-SU-2023:0091-1
SUSELinux Enterprise Real Time 15 SP3python-setuptools, python-setuptools-test, python-setuptools-wheel40.5.0-150100.6.6.1SUSE-SU-2023:0223-1
SUSELinux Enterprise Real Time 15 SP3python39-setuptools44.1.1-150300.7.6.1SUSE-SU-2023:0202-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5python36-setuptools44.1.1-8.6.1SUSE-SU-2023:0094-1
1 more for SUSE in the JSON and on SUSE's page.
openSUSELeap 15.4python-setuptools, python-setuptools-test, python-setuptools-wheel44.1.1-150400.3.3.1SUSE-SU-2023:0159-1
openSUSELeap 15.4python310-setuptools57.4.0-150400.4.3.1SUSE-SU-2023:0091-1
openSUSELeap 15.4python39-setuptools44.1.1-150300.7.6.1SUSE-SU-2023:0202-1
openSUSELeap 15.4, Leap 15.5python3-setuptools, python3-setuptools-test, python3-setuptools-wheel44.1.1-150400.9.6.1SUSE-SU-2023:4517-1
openSUSELeap Micro 5.2python-setuptools40.5.0-150100.6.6.1SUSE-SU-2023:0223-1
openSUSELeap Micro 5.3python-setuptools44.1.1-150400.3.3.1SUSE-SU-2023:0159-1
openSUSELeap Micro 5.3, Leap Micro 5.4python3-setuptools44.1.1-150400.9.6.1SUSE-SU-2023:4517-1
AlmaLinux8babel, python2-babel2.5.1-10.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2, python2-libs, python2-test and 4 more2.7.18-17.module_el8.10.0+3783+2756348e.almaALSA-2024:2987
AlmaLinux8python2-Cython0.28.1-7.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-Cython0.28.1-7.module_el8.6.0+3162+01a09e5aALSA-2024:2987
AlmaLinux8python2-PyMySQL0.8.0-10.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-attrs17.4.0-10.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-backports1.0-16.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-backports1.0-16.module_el8.6.0+3162+01a09e5aALSA-2024:2987
AlmaLinux8python2-backports-ssl_match_hostname3.5.0.1-12.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-bson, python2-pymongo, python2-pymongo-gridfs3.7.0-1.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-bson, python2-pymongo, python2-pymongo-gridfs3.7.0-1.module_el8.6.0+3162+01a09e5aALSA-2024:2987
AlmaLinux8python2-chardet3.0.4-10.module_el8.6.0+2781+fed64c13ALSA-2024:2987
81 more for AlmaLinux in the JSON.
Rocky Linux8Cython0:0.28.1-7.module+el8.9.0+1531+a18208f5RLSA-2024:2987
Rocky Linux8Cython0:0.29.21-5.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux8PyYAML0:3.12-16.module+el8.9.0+1531+a18208f5RLSA-2024:2987
Rocky Linux8PyYAML0:5.4.1-1.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux8babel0:2.5.1-10.module+el8.9.0+1531+a18208f5RLSA-2024:2987
Rocky Linux8mod_wsgi0:4.7.1-7.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux8numpy0:1.19.4-3.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux8numpy1:1.14.2-16.module+el8.9.0+1531+a18208f5RLSA-2024:2987
Rocky Linux8pybind110:2.7.1-1.module+el8.9.0+1357+a3b80af7RLSA-2024:2985
Rocky Linux8pytest0:3.4.2-13.module+el8.9.0+1531+a18208f5RLSA-2024:2987
Rocky Linux8pytest0:6.0.2-2.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux8python-PyMySQL0:0.10.1-2.module+el8.10.0+1582+bc278001RLSA-2024:2985
17 more for Rocky Linux in the JSON.

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8python39:3.9-8100020240214182535.7044f6c1Fixed 2024-05-22RHSA-2024:2985
Red Hat Enterprise Linux 8python39-devel:3.9-8100020240214182535.7044f6c1Fixed 2024-05-22RHSA-2024:2985
Red Hat Enterprise Linux 8python27:2.7-8100020240208011952.5f0f67deFixed 2024-05-22RHSA-2024:2987
Red Hat Enterprise Linux 8python-setuptools-0:39.2.0-6.el8_7.1Fixed 2023-02-21RHSA-2023:0835
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Supportpython39:3.9-8060020240916062113.6a631399Fixed 2024-09-23RHSA-2024:6915
Red Hat Enterprise Linux 8.6 Extended Update Supportpython-setuptools-0:39.2.0-7.el8_6Fixed 2023-11-21RHSA-2023:7395
Red Hat Enterprise Linux 8.6 Telecommunications Update Servicepython39:3.9-8060020240916062113.6a631399Fixed 2024-09-23RHSA-2024:6915
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutionspython39:3.9-8060020240916062113.6a631399Fixed 2024-09-23RHSA-2024:6915
Red Hat Enterprise Linux 8.8 Extended Update Supportpython39:3.9-8080020240402104641.93c2fc2fFixed 2024-07-09RHSA-2024:4421
Red Hat Enterprise Linux 8.8 Extended Update Supportpython39-devel:3.9-8080020240402104641.93c2fc2fFixed 2024-07-09RHSA-2024:4421
Red Hat Ansible Automation Platform 2python-setuptoolsNot affected
Red Hat Enterprise Linux 6python-setuptoolsOut of support scope
Red Hat Enterprise Linux 7python3-setuptoolsOut of support scope
Red Hat Enterprise Linux 7python-setuptoolsOut of support scope
Red Hat Enterprise Linux 8python3.11-setuptoolsNot affected
Red Hat Enterprise Linux 9python3.11-setuptoolsNot affected
Red Hat OpenShift Container Platform 4python-setuptoolsNot affected
Red Hat OpenShift Dev Spacespython-setuptoolsNot affected
Red Hat OpenStack Platform 16.1python-setuptoolsWill not fix
Red Hat Quay 3python-setuptoolsAffected
6 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2022-40897.

Attack patterns (CAPEC)

  • CAPEC-492 Regular Expression Exponential Blowup

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON