Executive brief
Waitress is a Python web application server used to host web services and applications. A remote attacker can cause the server to enter a busy-loop consuming excessive CPU resources by closing connections before the server fully initializes them, leading to potential service degradation or complete unavailability without requiring authentication or special privileges.
Technical details
The vulnerability is a resource cleanup failure (CWE-772) caused by a race condition in socket handling. When a remote client closes a connection before waitress calls getpeername(), the server fails to properly clean up the socket descriptor and remove it from the active socket list. The main thread then enters a busy-loop repeatedly attempting to write to the defunct socket without properly removing it, consuming CPU resources in the process. The attack is network-accessible, requires no authentication or user interaction, and can exhaust available sockets on the target system with minimal attacker resources. Waitress 3.0.1 patches the vulnerability by fixing the race condition and properly cleaning up failed connections.
Affected products
- Pylons Waitress all versions before 3.0.1
Timeline
- 2024-10-29: disclosed
- 2024-10-29: patched: Waitress 3.0.1 released with fixes