CVE-2022-40897
Python vulnerability analysis and mitigation

Overview

Python Packaging Authority (PyPA) setuptools before version 65.5.1 contains a Regular Expression Denial of Service (ReDoS) vulnerability in package_index.py. The vulnerability was discovered in December 2022 and allows remote attackers to cause a denial of service via HTML in a crafted package or custom PackageIndex page (PyUp Post, NVD).

Technical details

The vulnerability exists in the Regular Expression pattern used in package_index.py. The issue specifically involves a ReDoS condition where maliciously crafted input can cause excessive backtracking in the regular expression engine. The vulnerability has been assigned a CVSS v3.1 base score of 5.9 (Medium) with vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (PyUp Vulnerability).

Impact

If successfully exploited, this vulnerability can lead to a Denial of Service condition by causing the regular expression engine to enter a state of excessive backtracking, consuming system resources and potentially making the service unresponsive (Red Hat CVE).

Exploitability

The vulnerability can be exploited remotely by an attacker without requiring privileges or user interaction. However, the attack complexity is considered high, as it requires specific conditions to be met for successful exploitation (PyUp Vulnerability).

Mitigation and workarounds

The vulnerability was fixed in setuptools version 65.5.1. The fix involves limiting the amount of whitespace to search/backtrack in the regular expression pattern. Users are recommended to upgrade to version 65.5.1 or later to address this vulnerability (GitHub Commit).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-48039CRITICAL9.1
  • Python logoPython
  • meta-ads-mcp
NoYesAug 07, 2026
CVE-2026-48169HIGH8.8
  • Python logoPython
  • praisonai-platform
NoYesAug 07, 2026
GHSA-wvpp-8hx9-p66jHIGH8.8
  • Python logoPython
  • gitpython
NoYesAug 07, 2026
CVE-2026-71870MEDIUM4.8
  • Python logoPython
  • pypdf2
NoYesAug 07, 2026
CVE-2026-71852MEDIUM4.8
  • Python logoPython
  • pypdf
NoYesAug 07, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management