CVE-2022-40897
Aliases:GHSA-r9hx-vwmv-q579BIT-setuptools-2022-40897PYSEC-2022-43012
Advisory lineage Upstream: 0 Downstream: 23
Modified
Published: 22 Dec 2022, 00:00
Last modified:04 Nov 2025, 16:09
Vulnerability Summary
Overall Risk (default)
medium
34/100 CVSS Score
5.9 MEDIUM
v3.1 (cve.org)
EPSS Score
0.51% LOW
1% probability 0.00%
KEV
Not listed
Ransomware
No reports
Public exploits
1 found
Dark Web
Not detected
Timeline
22 Dec 2022, 00:00
Published
Vulnerability first disclosed
04 Nov 2025, 16:09
Last Modified
Vulnerability information updated
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.
CVSS Metrics
- v4.0•HIGH•Score: 8.7CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:L/SI:L/SA:N
- v3.1•MEDIUM•Score: 5.9CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
- v3.1•HIGH•Score: 7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Trends
Current EPSS score: 0.51%• Percentile: 67%
Techniques & Countermeasures
- CWE-1333•Inefficient Regular Expression Complexity
The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.
Affected Systems
- PyPI•setuptools
< 43a9c9bfa6aa626ec2a22540bea28d2ca77964be | < 65.5.1
- python•setuptools
< 65.5.1
References (23)
- https://github.com/pypa/setuptools/blob/fe8a98e696241487ba6ac9f91faa38ade939ec5d/setuptools/package_index.py#L200
- https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/
- https://github.com/pypa/setuptools/commit/43a9c9bfa6aa626ec2a22540bea28d2ca77964be
- https://pyup.io/vulnerabilities/CVE-2022-40897/52495/
- https://github.com/pypa/setuptools/compare/v65.5.0...v65.5.1
- https://security.netapp.com/advisory/ntap-20230214-0001/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R/
- https://security.netapp.com/advisory/ntap-20240621-0006/
- https://lists.debian.org/debian-lts-announce/2024/09/msg00018.html
- https://nvd.nist.gov/vuln/detail/CVE-2022-40897
- https://github.com/pypa/setuptools/issues/3659
- https://setuptools.pypa.io/en/latest
- https://security.netapp.com/advisory/ntap-20240621-0006
- https://security.netapp.com/advisory/ntap-20230214-0001
- https://pyup.io/vulnerabilities/CVE-2022-40897/52495
- https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R
- https://github.com/pypa/setuptools
- https://github.com/pypa/advisory-database/tree/main/vulns/setuptools/PYSEC-2022-43012.yaml