CVE-2022-40897
pypa/setuptools vulnerable to Regular Expression Denial of Service (ReDoS)
Reported by mitre · Published December 22, 2022
setuptools is fixed in 65.5.1 and 43a9c9bfa6aa626ec2a22540bea28d2ca77964be (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| setuptools | PyPI | 65.5.1, 43a9c9bfa6aa626ec2a22540bea28d2ca77964be |
| python2-setuptools | Amazon Linux | 41.2.0-4.amzn2.0.3 |
| setuptools | Bitnami | 65.5.1 |
| python3-setuptools-wheel | Amazon Linux | 59.6.0-2.amzn2023.0.4 |
| python3-setuptools | Amazon Linux | 59.6.0-2.amzn2023.0.4 |
| python-setuptools-wheel | Amazon Linux | 49.1.3-1.amzn2.0.3 |
| pytorch-cuda-11.8 | Chainguard | 2.3.1-r1 |
| setuptools | python | 65.5.1 |
| setuptools | Bitnami | 65.5.1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| amazon:2 | python2-setuptools | 0 |
| amazon:2023 | python3-setuptools-wheel | 0 |
| amazon:2023 | python3-setuptools | 0 |
| amazon:2 | python-setuptools-wheel | 0 |
| chainguard | pytorch-cuda-11.8 | 0 |
| PyPI | setuptools | 0 |
| n/a | n/a | * |
| chainguard | pytorch-cuda12 | 0 |
| amazon:2 | python3-setuptools | 0 |
Timeline
- Dec 22, 2022 CVE Published
- Dec 23, 2022 EPSS Score (30 in total, the first dated here)
- Mar 9, 2026 Security Advisory (59 in total, the first dated here)
- Jun 16, 2026 Coalition ESS Score
- Nov 21, 2026 Distribution Patch (54 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-40897
vulnetix vdb fixes CVE-2022-40897
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-40897/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- FEDORA-2023-9992b32c1f vendor-advisory
- FEDORA-2023-60e2b22be0 vendor-advisory
- https://nvd.nist.gov/vuln/detail/CVE-2022-40897 advisory
- https://github.com/advisories/GHSA-r9hx-vwmv-q579 advisory
- https://github.com/pypa/setuptools/issues/3659 url
- https://setuptools.pypa.io/en/latest url
- https://security.netapp.com/advisory/ntap-20240621-0006 advisory
- https://security.netapp.com/advisory/ntap-20230214-0001 advisory
- https://pyup.io/vulnerabilities/CVE-2022-40897/52495 url
- https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ADES3NLOE5QJKBLGNZNI2RGVOSQXA37R url
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YNA2BAH2ACBZ4TVJZKFLCR7L23BG5C3H url
…and 4 more