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.
CVE-2022-40897
This medium-severity CVE scores 5.9 under NVD CVSS v3. EPSS exploit probability: 0.5%, top 33% of all CVEs by exploit prediction. GitHub Security Advisory data not yet ingested — confidence will rise once GHSA publishes (typical lag: hours to days for open-source ecosystem CVEs; never for infrastructure-only CVEs).
- Lower severity and no public exploit yet
A fix is available — apply it.
- CVSS v3
- 5.9
- EG Score
- 5.9(medium)
- EPSS
- 83.6%
- KEV
- Not listed
Published
December 23, 2022
Last Modified
November 4, 2025
References (19)
- cve@mitrehttps://github.com/pypa/setuptools/blob/fe8a98e696241487ba6ac9f91faa38ade939ec5d/setuptools/package_index.py#L200
- cve@mitrehttps://github.com/pypa/setuptools/commit/43a9c9bfa6aa626ec2a22540bea28d2ca77964be
- cve@mitrehttps://github.com/pypa/setuptools/compare/v65.5.0...v65.5.1
- cve@mitrehttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R/
- cve@mitrehttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H/
- cve@mitrehttps://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/
- cve@mitrehttps://pyup.io/vulnerabilities/CVE-2022-40897/52495/
- cve@mitrehttps://security.netapp.com/advisory/ntap-20230214-0001/
- cve@mitrehttps://security.netapp.com/advisory/ntap-20240621-0006/
- af854a3a-2127-422b-91ae-364da2661108https://github.com/pypa/setuptools/blob/fe8a98e696241487ba6ac9f91faa38ade939ec5d/setuptools/package_index.py#L200
- af854a3a-2127-422b-91ae-364da2661108https://github.com/pypa/setuptools/commit/43a9c9bfa6aa626ec2a22540bea28d2ca77964be
- af854a3a-2127-422b-91ae-364da2661108https://github.com/pypa/setuptools/compare/v65.5.0...v65.5.1
- af854a3a-2127-422b-91ae-364da2661108https://lists.debian.org/debian-lts-announce/2024/09/msg00018.html
- af854a3a-2127-422b-91ae-364da2661108https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R/
- af854a3a-2127-422b-91ae-364da2661108https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H/
Vendor Advisories for CVE-2022-40897(2)
These vendors published their own advisory mentioning this CVE — often with vendor-specific remediation steps + affected product lists not in NVD.
Patch Availability(9)
| Vendor / Ecosystem | Fixed in / Patch | Released | Source |
|---|---|---|---|
| ubuntu | python3-setuptools (3.3-1ubuntu2+esm1) @ trusty | 2026-05-25 | ubuntu |
| redhat | python39:3.9-8060020240916062113.6a631399 | 2024-09-23 | redhat |
| redhat | python39-devel:3.9-8080020240402104641.93c2fc2f | 2024-07-09 | redhat |
| redhat | python39-devel:3.9-8100020240214182535.7044f6c1 | 2024-05-22 | redhat |
| redhat | python27:2.7-8100020240208011952.5f0f67de | 2024-05-22 | redhat |
| redhat | python-setuptools-0:39.2.0-7.el8_6 | 2023-11-21 | redhat |
| redhat | rh-python38-python-setuptools-0:41.6.0-8.el7 | 2023-11-08 | redhat |
| redhat | python-setuptools-0:53.0.0-10.el9_1.1 | 2023-02-28 | redhat |
| redhat | python-setuptools-0:39.2.0-6.el8_7.1 | 2023-02-21 | redhat |
Patches are aggregated from vendor advisories (Red Hat, Microsoft, Cisco, GitHub) and package ecosystems (OSV, GHSA). Multiple rows for the same upstream release have been deduplicated.
Affected Packages
(1 across 1 ecosystem)
PyPI(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| setuptools | 0.6b1 ... v59.8.0 (582 versions) | 65.5.1 | — |
Weakness Classification(1)
MITRE Common Weakness Enumeration — the root-cause categories this CVE belongs to.
Additional Vendor Advisories
(8)
Vendors that published advisories for this CVE beyond the curated set above. Broader coverage but minimal per-row detail — click through for the original advisory.
- Microsoft MSRCCVE-2022-408972022-12-31
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.
- Red HatRHSA-2023:0835MODERATE2022-12-22
RHSA-2023:0835 — Moderate
- Red HatRHSA-2023:0952MODERATE2022-12-22
RHSA-2023:0952 — Moderate
- Red HatRHSA-2023:7395MODERATE2022-12-22
RHSA-2023:7395 — Moderate
- Red HatRHSA-2024:2985MODERATE2022-12-22
RHSA-2024:2985 — Moderate
- Red HatRHSA-2024:2987MODERATE2022-12-22
RHSA-2024:2987 — Moderate
- Red HatRHSA-2024:6915MODERATE2022-12-22
RHSA-2024:6915 — Moderate
- UbuntuUSN-5817-1MEDIUM
Setuptools vulnerability
Data Freshness Timeline
(refreshed 8× in last 7d / 41× in last 30d)
Each row is a source pipeline that fetched or updated this CVE on that date, with what changed. For example, "NVD update" means NVD published or revised its analysis for this CVE; "MITRE cvelistV5" means we ingested or refreshed it from the CNA feed. Most recent first.
- 2026-07-11 08:25 UTCEPSS rescore
- 2026-07-11 08:25 UTCEPSS rescore
- 2026-07-09 19:08 UTCEPSS rescore
- 2026-07-08 15:12 UTCEPSS rescore
- 2026-07-07 13:44 UTCEPSS rescore
- 2026-07-06 16:25 UTCEPSS rescore
- 2026-07-06 02:21 UTCEPSS rescore
- 2026-07-05 02:28 UTCEPSS rescore
- 2026-07-04 06:29 UTCEPSS rescore
- 2026-07-02 16:58 UTCEPSS rescore
- 2026-07-01 15:04 UTCEPSS rescore
- 2026-06-30 23:20 UTCEPSS rescore
- 2026-06-30 23:20 UTCEPSS rescore
- 2026-06-29 14:04 UTCEPSS rescore
- 2026-06-29 14:04 UTCEPSS rescore
- 2026-06-28 14:06 UTCEPSS rescore
- 2026-06-28 10:49 UTCOSV refresh
- 2026-06-28 04:54 UTCEPSS rescore
- 2026-06-28 04:54 UTCEPSS rescore
- 2026-06-27 03:07 UTCEPSS rescore
- 2026-06-27 03:07 UTCEPSS rescore
- 2026-06-25 13:48 UTCEPSS rescore
- 2026-06-25 13:48 UTCEPSS rescore
- 2026-06-24 14:03 UTCEPSS rescore
- 2026-06-22 14:24 UTCEPSS rescore
Show 54 moreShow fewer
- 2026-06-21 14:55 UTCEPSS rescore
- 2026-06-21 14:55 UTCEPSS rescore
- 2026-06-21 01:58 UTCEPSS rescore
- 2026-06-21 01:58 UTCEPSS rescore
- 2026-06-19 19:24 UTCEPSS rescore
- 2026-06-19 19:24 UTCEPSS rescore
- 2026-06-18 17:51 UTCEPSS rescore
- 2026-06-18 17:51 UTCEPSS rescore
- 2026-06-17 17:51 UTCEPSS rescore
- 2026-06-17 17:51 UTCEPSS rescore
- 2026-06-16 17:51 UTCEPSS rescore
- 2026-06-15 17:46 UTCEPSS rescore
- 2026-06-14 23:16 UTCEPSS rescore
- 2026-06-13 22:59 UTCEPSS rescore
- 2026-06-12 23:10 UTCEPSS rescore
- 2026-06-12 23:10 UTCEPSS rescore
- 2026-06-11 13:58 UTCEPSS rescore
- 2026-06-11 13:58 UTCEPSS rescore
- 2026-06-10 22:17 UTCEPSS rescore
- 2026-06-10 20:47 UTCOSV refresh
- 2026-06-10 13:21 UTCEPSS rescore
- 2026-06-10 13:21 UTCEPSS rescore
- 2026-06-08 14:15 UTCEPSS rescore
- 2026-06-07 15:23 UTCEPSS rescore
- 2026-06-07 15:23 UTCEPSS rescore
- 2026-06-06 13:46 UTCEPSS rescore
- 2026-06-06 13:46 UTCEPSS rescore
- 2026-06-06 13:46 UTCEPSS rescore
- 2026-06-05 22:46 UTCEPSS rescore
- 2026-06-05 22:46 UTCEPSS rescore
- 2026-06-05 06:09 UTCEPSS rescore
- 2026-06-05 06:09 UTCEPSS rescore
- 2026-06-04 13:11 UTCEPSS rescore
- 2026-06-02 20:12 UTCEPSS rescore
- 2026-06-02 20:11 UTCEPSS rescore
- 2026-06-01 13:50 UTCEPSS rescore
- 2026-06-01 13:50 UTCEPSS rescore
- 2026-05-31 22:29 UTCEPSS rescore
- 2026-05-31 22:29 UTCEPSS rescore
- 2026-05-31 00:15 UTCEPSS rescore
- 2026-05-31 00:15 UTCEPSS rescore
- 2026-05-29 13:43 UTCEPSS rescore
- 2026-05-28 13:43 UTCEPSS rescore
- 2026-05-28 13:43 UTCEPSS rescore
- 2026-05-27 13:39 UTCEPSS rescore
- 2026-05-27 13:39 UTCEPSS rescore
- 2026-05-26 13:43 UTCEPSS rescore
- 2026-05-26 13:43 UTCEPSS rescore
- 2026-05-26 13:43 UTCEPSS rescore
- 2026-05-26 07:17 UTCEPSS rescore
- 2026-05-26 07:17 UTCEPSS rescore
- 2026-05-26 07:17 UTCEPSS rescore
- 2026-05-25 09:53 UTCEG score recompute
- 2026-05-25 09:53 UTCVendor advisory
Frequently asked(5)
What is CVE-2022-40897?
When was CVE-2022-40897 disclosed?
Is CVE-2022-40897 actively exploited?
What is the CVSS score of CVE-2022-40897?
How do I remediate CVE-2022-40897?
Dependency Blast Radius
See which npm, PyPI, Go, and Maven packages are affected by CVE-2022-40897
Is Your Infrastructure Affected by CVE-2022-40897?
EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.