Critical Vulnerability in python-setuptools: Denial of Service Risk

python-setuptools Updated 03 Oct 2025

Summary

23/01/2023
N/A
Yes i
Unrated
Not published

USN-5817-1: python-setuptools, setuptools vulnerability. Affects python-setuptools versions < 3.3-1ubuntu2+esm1. Fixed in 3.3-1ubuntu2+esm1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

python-setuptools is a widely used package in the Python ecosystem that facilitates the packaging of Python projects. It provides essential functionalities for building, distributing, and installing Python packages. This package is crucial for developers as it simplifies the management of dependencies and project configurations. However, recent vulnerabilities have raised concerns regarding its security, particularly in handling certain regex inputs, which can lead to potential denial of service attacks.

Vulnerability Detail

Sebastian Chnelik discovered that setuptools incorrectly handled certain regex inputs. This flaw allows an attacker to exploit the vulnerability, potentially causing a denial of service. The issue arises from improper validation of regex patterns, which can lead to excessive resource consumption, making the application unresponsive. This vulnerability is identified as CVE-2022-40897 and affects multiple versions of python-setuptools across various Ubuntu distributions.

How To Fix

Minimum fixed version

3.3-1ubuntu2+esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-setuptools

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary measure, users can avoid using regex patterns that may trigger the vulnerability until the package is updated. It is advisable to review and sanitize any user inputs that may be processed by the setuptools package.

Conclusion

The python-setuptools vulnerability poses a significant risk of denial of service due to improper handling of regex inputs. Users are strongly advised to update to the latest patched versions to secure their applications. For those unable to update immediately, implementing input sanitization can serve as a temporary measure. Utilize tools like Vulert to monitor for vulnerabilities in your software.

See every vulnerability recorded for python-setuptools →

Share this vulnerability

FAQ

The vulnerability involves improper handling of regex inputs, which can lead to denial of service attacks.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Simply upload your manifest file like package-lock.json to check for vulnerabilities.

Exploitation of this vulnerability can lead to denial of service, making the application unresponsive and affecting user experience.

Yes, patched versions of python-setuptools are available for various Ubuntu distributions. Users should update to the latest version to mitigate the risk.

If immediate updates are not possible, review and sanitize regex inputs to avoid triggering the vulnerability as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for python-setuptools.

How To Fix

Minimum fixed version

3.3-1ubuntu2+esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-setuptools

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback