CVE-2022-31015: Waitress Uncaught Exception (due To A Vulnerability
HIGHCVE-2022-31015 is a HIGH (CVSS 6.5) uncaught exception (due to a vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Waitress libraries in the PyPI ecosystem. The issue involves uncaught exception (due to a data race) leads to process termination in waitress. Remediation is available by upgrading affected packages to version 2.1.2.
CVE-2022-31015 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-31015
To remediate this vulnerability, upgrade all affected Waitress dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install waitress>=2.1.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show waitress
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-31015, inspect your installed packages using pip:
pip show waitress
Analyze the terminal output to locate any version of Waitress in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.2), your application is affected.
Note: The pip show waitress command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In Waitress, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-31015 Affected Waitress Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
waitress
|
PyPI |
≥ 2.1.0
< 2.1.2
|
2.1.2
|
References
Frequently Asked Questions
What is CVE-2022-31015?
Which Waitress versions are affected?
What version fixes CVE-2022-31015?
Is waitress affected?
What is the CVSS score of CVE-2022-31015?
What CWE is associated with CVE-2022-31015?
How can I check PyPI dependencies for CVE-2022-31015?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f5x9-8jwc-25rw",
"modified" : "2024-11-19T16:18:32Z",
"published" : "2022-06-02T20:37:48Z",
"aliases" : [ "CVE-2022-31015" ],
"summary" : "Uncaught Exception (due to a data race) leads to process termination in Waitress",
"details" : "### Impact\n\nWaitress 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.\n\n### Patches\n\nThis 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.\n\n### Workarounds\n\nThere 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.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in https://github.com/Pylons/waitress/issues (if not sensitive or security related)\n* email the Pylons Security mailing list: [pylons-project-security@googlegroups.com](mailto:pylons-project-security@googlegroups.com) (if security related)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "waitress"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.0"
}, {
"fixed" : "2.1.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/security/advisories/GHSA-f5x9-8jwc-25rw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31015"
}, {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/issues/374"
}, {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/pull/377"
}, {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/commit/4f6789b035610e0552738cdc4b35ca809a592d48"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Pylons/waitress"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/waitress/PYSEC-2022-205.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-248", "CWE-362" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-02T20:37:48Z",
"nvd_published_at" : "2022-05-31T23:15:00Z"
}
}