Python Packaging Authority (PyPA) setuptools before 65.5.1 allows remote attackers to…
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 12 fixed, 6 without a fix
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-1333.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
| — | setuptools (PyPI) | before 65.5.1 | 65.5.1 | Patch available | GHSA-r9hx-vwmv-q579 |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
- setuptools (PyPI) Vendor— Affected before 65.5.1 Fixed in 65.5.1 Patch available GHSA-r9hx-vwmv-q579
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:python:setuptools:*:*:*:*:*:*:*:* | before 65.5.1 | Vulnerable | python-pillow |
- cpe:2.3:a:python:setuptools:*:*:*:*:*:*:*:* Versions before 65.5.1 Vulnerable ·python-pillow
Remediation
- Fix · GHSA-r9hx-vwmv-q579 setuptools (PyPI) Fixed in 65.5.1 Advisory →
Red Hat 8 advisories
- RHSA-2024:6915 Released 2024-09-23 · Red Hat rating Moderatepython39:3.9 security update
- Red Hat Enterprise Linux AppStream AUS (v.8.6) PyYAML-5.4.1-1.module+el8.5.0+10613+59a13ec4.src::python39:3.9, mod_wsgi-4.7.1-4.module+el8.4.0+9822+20bf1249.src::python39:3.9, numpy-1.19.4-3.module+el8.5.0+12204+54860423.src::python39:3.9 +47
- Red Hat Enterprise Linux AppStream E4S (v.8.6) PyYAML-5.4.1-1.module+el8.5.0+10613+59a13ec4.src::python39:3.9, mod_wsgi-4.7.1-4.module+el8.4.0+9822+20bf1249.src::python39:3.9, numpy-1.19.4-3.module+el8.5.0+12204+54860423.src::python39:3.9 +47
- Red Hat Enterprise Linux AppStream TUS (v.8.6) PyYAML-5.4.1-1.module+el8.5.0+10613+59a13ec4.src::python39:3.9, mod_wsgi-4.7.1-4.module+el8.4.0+9822+20bf1249.src::python39:3.9, numpy-1.19.4-3.module+el8.5.0+12204+54860423.src::python39:3.9 +47
- RHSA-2024:4421 Released 2024-07-09 · Red Hat rating Moderatepython39:3.9 and python39-devel:3.9 security update
- Red Hat CodeReady Linux Builder EUS (v.8.8) Cython-0.29.21-5.module+el8.4.0+9822+20bf1249.src::python39-devel:3.9, pybind11-2.7.1-1.module+el8.6.0+12838+640e6226.src::python39-devel:3.9, pytest-6.0.2-2.module+el8.4.0+9822+20bf1249.src::python39-devel:3.9 +33
- Red Hat Enterprise Linux AppStream EUS (v.8.8) PyYAML-5.4.1-1.module+el8.5.0+10613+59a13ec4.src::python39:3.9, mod_wsgi-4.7.1-5.module+el8.7.0+16654+645aad7f.src::python39:3.9, numpy-1.19.4-3.module+el8.5.0+12204+54860423.src::python39:3.9 +47
- RHSA-2024:2987 Released 2024-05-22 · Red Hat rating Moderatepython27:2.7 security update
- Red Hat Enterprise Linux AppStream (v. 8) Cython-0.28.1-7.module+el8.9.0+19487+7dc18407.src::python27:2.7, PyYAML-3.12-16.module+el8.9.0+19487+7dc18407.src::python27:2.7, babel-2.5.1-10.module+el8.9.0+19487+7dc18407.noarch::python27:2.7 +47
Show 5 more Red Hat advisories
- RHSA-2024:2985 Released 2024-05-22 · Red Hat rating Moderatepython39:3.9 and python39-devel:3.9 security update
- Red Hat Enterprise Linux AppStream (v. 8) PyYAML-5.4.1-1.module+el8.9.0+19644+d68f775d.src::python39:3.9, mod_wsgi-4.7.1-7.module+el8.9.0+19644+d68f775d.src::python39:3.9, numpy-1.19.4-3.module+el8.9.0+19644+d68f775d.src::python39:3.9 +47
- Red Hat Enterprise Linux CRB (v. 8) Cython-0.29.21-5.module+el8.9.0+19644+d68f775d.src::python39-devel:3.9, pybind11-2.7.1-1.module+el8.9.0+19644+d68f775d.src::python39-devel:3.9, pytest-6.0.2-2.module+el8.9.0+19644+d68f775d.src::python39-devel:3.9 +33
- RHSA-2023:7395 Released 2023-11-21 · Red Hat rating Moderatepython-setuptools security update
- Red Hat Enterprise Linux BaseOS EUS (v.8.6) platform-python-setuptools-39.2.0-7.el8_6, python-setuptools-39.2.0-7.el8_6, python3-setuptools-39.2.0-7.el8_6 +1
- RHSA-2023:6793 Released 2023-11-08 · Red Hat rating Importantrh-python38-python security update
- Red Hat Software Collections for RHEL Workstation(v. 7) rh-python38-python-3.8.18-2.el7, rh-python38-python-cryptography-2.8-6.el7, rh-python38-python-debug-3.8.18-2.el7 +14
- Red Hat Software Collections for RHEL(v. 7) rh-python38-python-3.8.18-2.el7, rh-python38-python-cryptography-2.8-6.el7, rh-python38-python-debug-3.8.18-2.el7 +14
- RHSA-2023:0952 Released 2023-02-28 · Red Hat rating Moderatepython-setuptools security update
- Red Hat Enterprise Linux BaseOS (v. 9) python-setuptools-53.0.0-10.el9_1.1, python3-setuptools-53.0.0-10.el9_1.1, python3-setuptools-wheel-53.0.0-10.el9_1.1
- RHSA-2023:0835 Released 2023-02-21 · Red Hat rating Moderatepython-setuptools security update
- Red Hat Enterprise Linux BaseOS (v. 8) platform-python-setuptools-39.2.0-6.el8_7.1, python-setuptools-39.2.0-6.el8_7.1, python3-setuptools-39.2.0-6.el8_7.1 +1
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat OpenStack Platform 16.1 | Affected | No fix planned: Will not fix |
| Red Hat Quay 3 | Affected | No fix yet |
| Service Telemetry Framework 1.3 for RHEL 8 | Affected | No fix planned: Out of support scope |
| Service Telemetry Framework 1.4 for RHEL 8 | Affected | No fix planned: Will not fix |
| Red Hat CodeReady Linux Builder EUS (v.8.8) | Fixed | RHSA-2024:4421 |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2024:2985, RHSA-2024:2987 |
| Red Hat Enterprise Linux AppStream AUS (v.8.6) | Fixed | RHSA-2024:6915 |
| Red Hat Enterprise Linux AppStream E4S (v.8.6) | Fixed | RHSA-2024:6915 |
| Red Hat Enterprise Linux AppStream EUS (v.8.8) | Fixed | RHSA-2024:4421 |
| Red Hat Enterprise Linux AppStream TUS (v.8.6) | Fixed | RHSA-2024:6915 |
| Red Hat Enterprise Linux BaseOS (v. 8) | Fixed | RHSA-2023:0835 |
| Red Hat Enterprise Linux BaseOS (v. 9) | Fixed | RHSA-2023:0952 |
| Red Hat Enterprise Linux BaseOS EUS (v.8.6) | Fixed | RHSA-2023:7395 |
| Red Hat Enterprise Linux CRB (v. 8) | Fixed | RHSA-2024:2985 |
| Red Hat Software Collections for RHEL Workstation(v. 7) | Fixed | RHSA-2023:6793 |
| Red Hat Software Collections for RHEL(v. 7) | Fixed | RHSA-2023:6793 |
Not affected: 9 products
- Red Hat Ansible Automation Platform 2
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat OpenShift Container Platform 4
- Red Hat OpenShift Dev Spaces
- Red Hat Satellite 6
- Red Hat Software Collections for RHEL Workstation(v. 7)
- Red Hat Software Collections for RHEL(v. 7)
- Red Hat Update Infrastructure 4 for Cloud Providers
Timeline
- 2026-10-02 Threatist record created from CVE-2022-40897
- 2026-10-03 Alias added: GHSA-r9hx-vwmv-q579
References
Advisory 6
- https://github.com/pypa/setuptools/blob/fe8a98e696241487ba6ac9f91faa38ade939ec5d/setuptools/package_index.py#L200
- https://pyup.io/vulnerabilities/CVE-2022-40897/52495/
- https://github.com/pypa/setuptools/compare/v65.5.0...v65.5.1
- FEDORA-2023-9992b32c1f
- FEDORA-2023-60e2b22be0
- https://nvd.nist.gov/vuln/detail/CVE-2022-40897
Other 15
- https://security.netapp.com/advisory/ntap-20230214-0001/
- https://security.netapp.com/advisory/ntap-20240621-0006/
- 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/[email protected]/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H
- https://lists.fedoraproject.org/archives/list/[email protected]/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://lists.debian.org/debian-lts-announce/2024/09/msg00018.html
- https://github.com/pypa/setuptools
- https://github.com/pypa/advisory-database/tree/main/vulns/setuptools/PYSEC-2022-43012.yaml
More python-pillow Setuptools vulnerabilities
- TI-2025-29803 setuptools has a path traversal vulnerability in PackageIndex.download that leads to Arbitrary File Write CVSS 4.0HIGH 7.7
- TI-2026-42704 setuptools: MANIFEST.in exclusion bypass in sdist via Unicode normalization collision (NFC/NFD) on macOS APFS/HFS+ CVSS 3.1MEDIUM 6.1
- TI-2013-01435 easy_install in setuptools before 0.7 uses HTTP to retrieve packages from the PyPI… CVSS 2.0MEDIUM 6.8
Sources
- CVE-2022-40897 · CVE Program
- CVE-2022-40897 · NVD
- FIRST EPSS
- GHSA-r9hx-vwmv-q579 · GitHub Advisory Database · CC BY 4.0
- CVE-2022-40897 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences