# CVE-2022-31015: Uncaught Exception (due to a data race) leads to process termination in Waitress

Source: https://junglewise.ai/threats/cve-2022-31015-uncaught-exception-due-to-a-data-race-leads-to-process  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-05-31  
License: CC BY 4.0 with a link back

CVE-2022-31015 · Severity: low · CVSS 3.1 · Published 2022-05-31

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.

Technologies: [waitress (PyPI)](https://junglewise.ai/threats/technologies/waitress). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2022-31015 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-31015 being exploited in the wild.

**How severe is CVE-2022-31015?** Low severity, with a CVSS score of 3.1, published 31 May 2022.

**Which products and versions are affected?** waitress (PyPI) ECOSYSTEM:introduced=2.1.0,fixed=2.1.2, GIT:introduced=0,fixed=4f6789b035610e0552738cdc4b35ca809a592d48|ECOSYSTEM:introduced=2.1.0,fixed=2.1.2.

**Is there a fix for CVE-2022-31015?** Yes. waitress (PyPI): upgrade to 2.1.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2022-31015?** Check whether you run waitress (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- waitress (PyPI): upgrade to 2.1.2 or later

  ```sh
  pip install "waitress>=2.1.2"
  ```


## Affected products

- waitress (PyPI) ECOSYSTEM:introduced=2.1.0,fixed=2.1.2, GIT:introduced=0,fixed=4f6789b035610e0552738cdc4b35ca809a592d48|ECOSYSTEM:introduced=2.1.0,fixed=2.1.2

## Identifiers

- CVE-2022-31015
- GHSA-f5x9-8jwc-25rw
- PYSEC-2022-205

## Related threats

- [Waitress denial of service via unclean socket handling](https://junglewise.ai/threats/cve-2024-49769-waitress-denial-of-service-via-unclean-socket-handling)
- [Waitress has request processing race condition in HTTP pipelining with invalid first request](https://junglewise.ai/threats/cve-2024-49768-waitress-has-request-processing-race-condition-in-http-pipelining)
- [HTTP Request Smuggling in waitress](https://junglewise.ai/threats/cve-2022-24761-http-request-smuggling-in-waitress)
- [Catastrophic backtracking in regex allows Denial of Service in Waitress](https://junglewise.ai/threats/cve-2020-5236-catastrophic-backtracking-in-regex-allows-denial-of-service-in)
- [Duplicate Advisory: Inconsistent Interpretation of HTTP Requests in Waitress](https://junglewise.ai/threats/cve-2019-16792-http-request-smuggling-content-length-sent-twice-in-waitress)
