CVE-2024-49768: Waitress Waitress Has Request Processing Race Vulnerability
CRITICALCVE-2024-49768 is a CRITICAL (CVSS 9.1) waitress has request processing race vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Waitress libraries in the PyPI ecosystem. The issue involves waitress has request processing race condition in http pipelining with invalid first request. Remediation is available by upgrading affected packages to version 3.0.1.
CVE-2024-49768 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2024-49768
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>=3.0.1
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-2024-49768, 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 3.0.1), 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-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. 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-2024-49768 Affected Waitress Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
waitress
|
PyPI |
≥ 2.0.0
< 3.0.1
|
3.0.1
|
References
Frequently Asked Questions
What is CVE-2024-49768?
Which Waitress versions are affected?
What version fixes CVE-2024-49768?
Is waitress affected?
What is the CVSS score of CVE-2024-49768?
What CWE is associated with CVE-2024-49768?
How can I check PyPI dependencies for CVE-2024-49768?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9298-4cf8-g4wj",
"modified" : "2025-01-21T17:53:26Z",
"published" : "2024-10-29T14:45:03Z",
"aliases" : [ "CVE-2024-49768" ],
"summary" : "Waitress has request processing race condition in HTTP pipelining with invalid first request",
"details" : "### Impact\n\nA remote client may send a request that is exactly `recv_bytes` (defaults to 8192) long, followed by a secondary request using HTTP pipelining.\n\nWhen request lookahead is disabled (default) we won't read any more requests, and when the first request fails due to a parsing error, we simply close the connection.\n\nHowever when request lookahead is enabled, it is possible to process and receive the first request, start sending the error message back to the client while we read the next request and queue it. This will allow the secondary request to be serviced by the worker thread while the connection should be closed.\n\n### Patches\n\nWaitress 3.0.1 fixes the race condition.\n\n### Workarounds\n\nDisable `channel_request_lookahead`, this is set to `0` by default disabling this feature. For this vulnerability this value is required to be changed from the default.\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\n### Thanks\n\n- m4yfly and urn1ce From TianGong Team of Legendsec at Qi'anxin Group.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "waitress"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "3.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/security/advisories/GHSA-9298-4cf8-g4wj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-49768"
}, {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/commit/e4359018537af376cf24bd13616d861e2fb76f65"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Pylons/waitress"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/waitress/PYSEC-2024-210.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-367", "CWE-444" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-10-29T14:45:03Z",
"nvd_published_at" : "2024-10-29T15:15:11Z"
}
}