PyPI: setuptools

CVE-2022-40897

Safety vulnerability ID: SFTY-20221223-00666

Safety legacy ID: pyup.io-52495

Setuptools 65.5.1 includes a fix for CVE-2022-40897: 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.

Created at: Nov 6, 2025Updated at: Nov 6, 2025

Overview

pypa/setuptools vulnerable to Regular Expression Denial of Service (ReDoS)

Advisory

Setuptools 65.5.1 includes a fix for CVE-2022-40897: 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.

Affected Package

Affecting setuptools package, versions
<65.5.1

Also affects

---

How to Fix

Upgrade
setuptools
to
65.5.1
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

References

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more