CVE-2024-49769·Python vulnerability
Waitress is a Web Server Gateway Interface server for Python 2 and 3. When a remote client closes the connection before waitress has had the opportunity to call getpeername() waitress won't correctly clean up the connection leading to the main thread attempting to write to a socket that no longer exists, but not removing it from the list of sockets to attempt to process. This leads to a busy-loop calling the write function. A remote attacker could run waitress out of available sockets with very little resources required. Waitress 3.0.1 contains fixes that remove the race condition.
- Severity
- high
- Software
- Python
- Fixed in
- 3.0.1
- Published
- 2024-10-29
Affected versions
Until: 3.0.1
Fixed in: 3.0.1
How to fix this CVE
Update Waitress to version 3.0.1 or later to eliminate a race condition that causes socket exhaustion when clients disconnect prematurely. This vulnerability allows attackers to exhaust server resources by triggering repeated connection drops, leading to a busy-loop that consumes available sockets. Apply the patch immediately to restore normal server stability and prevent denial-of-service conditions.
sudo dnf update python3-waitressDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check installed Waitress version with: python3 -c "import waitress; print(waitress.__version__)"
- Step 2: Verify if Waitress is actively serving requests by checking running processes: ps aux | grep waitress
- Step 3: Monitor system logs for repeated socket write failures: grep -i 'socket\|write error' /var/log/syslog /var/log/messages
- Step 4: Confirm the patch by verifying Waitress version is 3.0.1 or higher after upgrade: python3 -c "import waitress; assert waitress.__version__ >= '3.0.1'"
FAQ
What is CVE-2024-49769?
CVE-2024-49769 is a denial-of-service vulnerability in Waitress (Python WSGI server) where premature client disconnections trigger a race condition, leaving dead sockets in the server's processing queue. This causes the main thread to enter a busy-loop repeatedly attempting to write to invalid sockets, exhausting system resources.
Is CVE-2024-49769 being actively exploited?
No, CVE-2024-49769 is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are currently available. However, the vulnerability can be triggered with minimal resources by any unauthenticated remote attacker.
What versions of Python are affected by CVE-2024-49769?
All versions of Waitress prior to 3.0.1 are affected. This includes Waitress for both Python 2 and Python 3 environments running vulnerable versions of the WSGI server.
How do I check if my server is vulnerable to CVE-2024-49769?
Run: python3 -c "import waitress; print('Vulnerable' if waitress.__version__ < '3.0.1' else 'Patched')" to determine your current Waitress version status.
Does Defensia detect CVE-2024-49769?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Waitress is installed on a monitored server, CVE-2024-49769 will appear in your dashboard with remediation steps.
Related Python CVEs
References
- https://github.com/Pylons/waitress/commit/1ae4e894c9f76543bee06584001583fc6fa8c95c
- https://github.com/Pylons/waitress/issues/418
- https://github.com/Pylons/waitress/pull/435
- https://github.com/Pylons/waitress/security/advisories/GHSA-3f84-rpwh-47g6
- https://lists.debian.org/debian-lts-announce/2024/11/msg00012.html
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-49769. Free for 1 server.
Get started free