CVE-2022-31015: Uncaught Exception (due to a data race) leads to process termination in Waitress
Impact
Waitress may terminate early due to a thread closing a socket while the main thread is about to call select(). This will lead to the main thread raising an exception that is not handled and then causing the entire application to be killed.
Patches
This issue has been fixed in Waitress 2.1.2 by no longer allowing the WSGI thread to close the socket, instead it is always delegated to the main thread.
Workarounds
There is no work-around, however users using waitress behind a reverse proxy server are less likely to have issues if the reverse proxy always reads the full response.
For more information
If you have any questions or comments about this advisory: Open an issue in https://github.com/Pylons/waitress/issues (if not sensitive or security related) email the Pylons Security mailing list: pylons-project-security@googlegroups.com (if security related)
Other sources
Waitress is a Web Server Gateway Interface server for Python 2 and 3. Waitress versions 2.1.0 and 2.1.1 may terminate early due to a thread closing a socket while the main thread is about to call select(). This will lead to the main thread raising an exception that is not handled and then causing the entire application to be killed. This issue has been fixed in Waitress 2.1.2 by no longer allowing the WSGI thread to close the socket. Instead, that is always delegated to the main thread. There is no work-around for this issue. However, users using waitress behind a reverse proxy server are less likely to have issues if the reverse proxy always reads the full response.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/waitressto a version that resolves this vulnerability.Fixed in 2.1.2 - Upgrade
Upgrade
debian/waitressto a version that resolves this vulnerability.Fixed in 2.1.2-2+deb12u1Fixed in 3.0.2-1Fixed in 3.0.2-2 - Upgrade
Upgrade
alpine/py3-waitressto a version that resolves this vulnerability.Fixed in 2.1.2-r0 - Upgrade
Upgrade
debian/waitressto a version that resolves this vulnerability.Fixed in 2.1.2-1 - Upgrade
Upgrade
Waitressto a version that resolves this vulnerability.Fixed in 2.1.2 - Compensating control
If running Waitress behind a reverse proxy, configure the reverse proxy to always read the full response.
Event History
Frequently Asked Questions
What is CVE-2022-31015?
CVE-2022-31015 is a vulnerability in Waitress, a Web Server Gateway Interface server for Python 2 and 3.
What is the severity of CVE-2022-31015?
CVE-2022-31015 has a severity rating of medium (5.9).
How does CVE-2022-31015 affect Waitress?
CVE-2022-31015 affects Waitress versions 2.1.0 to 2.1.2.
What is the impact of CVE-2022-31015?
CVE-2022-31015 can lead to the main thread raising an unhandled exception and causing the server to terminate early.
How can I fix CVE-2022-31015?
To fix CVE-2022-31015, it is recommended to update to Waitress version 2.1.3 or later.