CVE-2022-40897: Input Validation

Published Dec 22, 2022
·
Updated

Pypa Setuptools is vulnerable to a denial of service, caused by improper input validation. By sending request with a specially crafted regular expression, an remote attacker could exploit this vulnerability to cause a denial of service.

Other sources

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 packageindex.py.

— Red Hat

Python Packaging Authority (PyPA)'s setuptools is a library designed to facilitate packaging Python projects. Setuptools version 65.5.0 and earlier could allow remote attackers to cause a denial of service by fetching malicious HTML from a PyPI package or custom PackageIndex page due to a vulnerable Regular Expression in packageindex. This has been patched in version 65.5.1.

— GitHub

Affected Software

19 affected componentsFixes available
pip/setuptools<65.5.1
65.5.1
Python setuptools<65.5.1
IBM Concert Software<=1.0.0 - 1.0.1
debian/setuptools<65.6.3-1
65.6.3-1
debian/setuptools<65.6.3-1
65.6.3-1
debian/setuptools<65.6.3-1
65.6.3-1
debian/setuptools
52.0.0-4+deb11u165.6.3-1
ubuntu/python-pip<1.5.4-1ubuntu4+esm2
1.5.4-1ubuntu4+esm2
ubuntu/python-setuptools<3.3-1ubuntu2+esm1
3.3-1ubuntu2+esm1
ubuntu/python-setuptools<20.7.0-1ubuntu0.1~esm1
20.7.0-1ubuntu0.1~esm1
ubuntu/python-pip<8.1.1-2ubuntu0.6+esm3
8.1.1-2ubuntu0.6+esm3
ubuntu/python-pip<9.0.1-2.3~ubuntu1.18.04.6
9.0.1-2.3~ubuntu1.18.04.6
ubuntu/python-setuptools<39.0.1-2ubuntu0.1
39.0.1-2ubuntu0.1
ubuntu/python-pip<20.0.2-5ubuntu1.7
20.0.2-5ubuntu1.7
ubuntu/python-setuptools<44.0.0-2ubuntu0.1
44.0.0-2ubuntu0.1
ubuntu/setuptools<45.2.0-1ubuntu0.1
45.2.0-1ubuntu0.1
ubuntu/python-pip<22.0.2+dfsg-1ubuntu0.1
22.0.2+dfsg-1ubuntu0.1
ubuntu/python-setuptools<44.1.1-1.2ubuntu0.22.04.1
44.1.1-1.2ubuntu0.22.04.1
ubuntu/setuptools<59.6.0-1.2ubuntu0.22.04.1
59.6.0-1.2ubuntu0.22.04.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/setuptools to a version that resolves this vulnerability.

    Fixed in 65.5.1
  2. Upgrade

    Upgrade debian/setuptools to a version that resolves this vulnerability.

    Fixed in 65.6.3-1
  3. Upgrade

    Upgrade debian/setuptools to a version that resolves this vulnerability.

    Fixed in 52.0.0-4+deb11u1Fixed in 65.6.3-1
  4. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 1.5.4-1ubuntu4+esm2
  5. Upgrade

    Upgrade ubuntu/python-setuptools to a version that resolves this vulnerability.

    Fixed in 3.3-1ubuntu2+esm1
  6. Upgrade

    Upgrade ubuntu/python-setuptools to a version that resolves this vulnerability.

    Fixed in 20.7.0-1ubuntu0.1~esm1
  7. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 8.1.1-2ubuntu0.6+esm3
  8. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 9.0.1-2.3~ubuntu1.18.04.6
  9. Upgrade

    Upgrade ubuntu/python-setuptools to a version that resolves this vulnerability.

    Fixed in 39.0.1-2ubuntu0.1
  10. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 20.0.2-5ubuntu1.7
  11. Upgrade

    Upgrade ubuntu/python-setuptools to a version that resolves this vulnerability.

    Fixed in 44.0.0-2ubuntu0.1
  12. Upgrade

    Upgrade ubuntu/setuptools to a version that resolves this vulnerability.

    Fixed in 45.2.0-1ubuntu0.1
  13. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 22.0.2+dfsg-1ubuntu0.1
  14. Upgrade

    Upgrade ubuntu/python-setuptools to a version that resolves this vulnerability.

    Fixed in 44.1.1-1.2ubuntu0.22.04.1
  15. Upgrade

    Upgrade ubuntu/setuptools to a version that resolves this vulnerability.

    Fixed in 59.6.0-1.2ubuntu0.22.04.1
  16. Upgrade

    Upgrade setuptools to a version that resolves this vulnerability.

    Fixed in 65.5.1

Event History

Dec 22, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Dec 23, 2022
Data Sourced
via OSV·12:15 AM
DescriptionSeverityAffected Software
Data Sourced
12:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·12:30 AM
Data Sourced
via GitHub·12:30 AM
DescriptionSeverityWeaknessAffected Software
Oct 20, 2023
Updated
via IBM·12:00 AM
Affected Software
Nov 21, 2023
Data Sourced
via Red Hat·11:40 AM
DescriptionSeverityAffected Software
Feb 23, 2024
Data Sourced
via IBM·12:00 AM
DescriptionSeverityAffected Software
Updated
via IBM·12:00 AM
Affected Software
Feb 26, 2024
Updated
via IBM·12:00 AM
Affected Software
Jun 24, 2024
Advisory Published
via GitHub·09:24 PM
Event
via GitHub·09:24 PM
Oct 21, 2024
Updated
via IBM·12:00 AM
Affected Software
Oct 29, 2024
Updated
via NVD·03:35 PM
SeverityWeaknessAffected Software
Apr 14, 2025
Updated
via IBM·12:00 AM
Affected Software
Nov 4, 2025
Updated
via NVD·04:15 PM
RemedyAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is CVE-2022-40897?

CVE-2022-40897 is a vulnerability in Python Packaging Authority (PyPA) setuptools before 65.5.1 that allows remote attackers to cause a denial of service via HTML in a crafted package or custom PackageIndex page due to improper input validation.

2

How does CVE-2022-40897 impact Python Setuptools?

CVE-2022-40897 affects Python Setuptools versions prior to 65.5.1 and can be exploited to cause a denial of service by sending malicious HTML in a crafted package or custom PackageIndex page.

3

How does CVE-2022-40897 impact IBM Cognos Dashboards on Cloud Pak for Data?

CVE-2022-40897 impacts IBM Cognos Dashboards on Cloud Pak for Data up to version 4.7.0 and can be exploited to cause a denial of service by sending malicious HTML in a crafted package or custom PackageIndex page.

4

How can I fix CVE-2022-40897?

To fix CVE-2022-40897, you should update Python Setuptools to version 65.5.1 or later.

5

Are there any references for CVE-2022-40897?

Yes, you can find references for CVE-2022-40897 at the following links: [Link 1](https://exchange.xforce.ibmcloud.com/vulnerabilities/243028), [Link 2](https://www.ibm.com/support/pages/node/7031207), [Link 3](https://github.com/pypa/setuptools/blob/fe8a98e696241487ba6ac9f91faa38ade939ec5d/setuptools/package_index.py#L200).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203