# CVE-2022-40897: pypa/setuptools vulnerable to Regular Expression Denial of Service (ReDoS)

- Severity: Medium 5.9 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.35%, higher than 84% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-12-22T00:00:00.000Z
- Modified: 2026-09-08T08:48:19.335Z
- Also known as: GHSA-r9hx-vwmv-q579, BIT-SETUPTOOLS-2022-40897, PYSEC-2022-43012
- Weaknesses: CWE-1333
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: mitre

## 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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- setuptools (PyPI): before 65.5.1; before 43a9c9bfa6aa626ec2a22540bea28d2ca77964be
- python setuptools: before 65.5.1
- setuptools (Bitnami): before 65.5.1

## Every score

- CISA-ADP: 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`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:L/SI:L/SA:N`
- NVD: 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`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/> (exploit, advisory, patch, technical-description, vendor-advisory, web)
- <https://github.com/pypa/setuptools/blob/fe8a98e696241487ba6ac9f91faa38ade939ec5d/setuptools/package_index.py#L200> (advisory, third-party-advisory, web)
- <https://github.com/pypa/setuptools/commit/43a9c9bfa6aa626ec2a22540bea28d2ca77964be> (advisory, fix, patch, third-party-advisory, web)
- <https://pyup.io/vulnerabilities/CVE-2022-40897/52495/> (advisory, third-party-advisory, web)
- <https://github.com/pypa/setuptools/compare/v65.5.0...v65.5.1> (advisory, release-notes, third-party-advisory, web)
- <https://security.netapp.com/advisory/ntap-20230214-0001/> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H/> (vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R/> (vendor-advisory, web)
- <https://security.netapp.com/advisory/ntap-20240621-0006/> (web)
- <https://lists.debian.org/debian-lts-announce/2024/09/msg00018.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-40897> (advisory, web)
- <https://github.com/pypa/setuptools/issues/3659> (web)
- <https://setuptools.pypa.io/en/latest> (web)
- <https://security.netapp.com/advisory/ntap-20240621-0006> (web)
- <https://security.netapp.com/advisory/ntap-20230214-0001> (web)
- <https://pyup.io/vulnerabilities/CVE-2022-40897/52495> (web)
- <https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R> (web)
- <https://github.com/pypa/setuptools> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/setuptools/PYSEC-2022-43012.yaml> (web)
- <https://github.com/advisories/GHSA-r9hx-vwmv-q579> (advisory)

## Sources

- CVE List: [CVE-2022-40897](https://www.cve.org/CVERecord?id=CVE-2022-40897), CVE Terms of Use, modified 2025-11-04
- GitHub Advisory Database: [GHSA-r9hx-vwmv-q579](https://github.com/advisories/GHSA-r9hx-vwmv-q579), CC-BY-4.0, modified 2026-08-07
- NVD: [CVE-2022-40897](https://nvd.nist.gov/vuln/detail/CVE-2022-40897), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2022-43012](https://osv.dev/vulnerability/PYSEC-2022-43012), CC-BY-4.0, modified 2026-06-10
- Bitnami Vulnerability Database: [BIT-SETUPTOOLS-2022-40897](https://osv.dev/vulnerability/BIT-SETUPTOOLS-2022-40897), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2022-40897 · Whole record: https://cve.day/CVE-2022-40897.json · Rebuilt by cve.day 2026-11-25T22:58:17.829Z
