GHSA-m5ff-3wj3-8ph4: HTTP Request Smuggling Invalid Whitespace Characters Vulnerability
HIGHGHSA-m5ff-3wj3-8ph4 is a HIGH invalid whitespace characters vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting HTTP Request Smuggling libraries in the PyPI ecosystem. The issue involves invalid whitespace characters in headers in waitress. Remediation is available by upgrading affected packages to version 1.4.1.
GHSA-m5ff-3wj3-8ph4 at a Glance
How to Fix GHSA-m5ff-3wj3-8ph4
To remediate this vulnerability, upgrade all affected HTTP Request Smuggling 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>=1.4.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 GHSA-m5ff-3wj3-8ph4, inspect your installed packages using pip:
pip show waitress
Analyze the terminal output to locate any version of HTTP Request Smuggling in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.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-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where the product acts as an intermediary http agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed http requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination. In HTTP Request Smuggling, 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
GHSA-m5ff-3wj3-8ph4 Affected HTTP Request Smuggling Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
waitress
|
PyPI |
< 1.4.1
|
1.4.1
|
References
Frequently Asked Questions
What is GHSA-m5ff-3wj3-8ph4?
Which HTTP Request Smuggling versions are affected?
What version fixes GHSA-m5ff-3wj3-8ph4?
Is waitress affected?
What CWE is associated with GHSA-m5ff-3wj3-8ph4?
How can I check PyPI dependencies for GHSA-m5ff-3wj3-8ph4?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m5ff-3wj3-8ph4",
"modified" : "2019-12-26T16:34:06Z",
"published" : "2019-12-26T16:34:38Z",
"aliases" : [ ],
"summary" : "HTTP Request Smuggling: Invalid whitespace characters in headers in Waitress",
"details" : "### Impact\n\nIf a proxy server is used in front of waitress, an invalid request may be sent by an attacker that bypasses the front-end and is parsed differently by waitress leading to a potential for HTTP request smuggling.\n\n```\nContent-Length: 10\nTransfer-Encoding: [\\x0b]chunked\n```\n\nFor clarity:\n\n```\n0x0b == vertical tab\n```\n\nWould get parsed by Waitress as being a `chunked` request, but a front-end server would use the `Content-Length` instead as the `Transfer-Encoding` header is considered invalid due to containing invalid characters.\n\nIf a front-end server does HTTP pipelining to a backend Waitress server this could lead to HTTP request splitting which may lead to potential cache poisoning or unexpected information disclosure.\n\n### Patches\n\nPlease upgrade to Waitress 1.4.1 which fixes this issue with stricter HTTP field validation.\n\nWaitress 1.4.1 due to this change has become much more strict in what is allowed in header values, while the maintainers don't believe that these changes will cause any issues, it may cause failures with non-conformist reverse proxies or clients, and it is highly recommend that users validate the changes in their environment and make sure it won't cause any unacceptable failures.\n\n### Workarounds\n\nYou may enable additional protections on front-end servers, those that follow RFC7230 correctly would drop the request with a 400 Bad Request.\n\nWaitress will now correctly responds to the request with a 400 Bad Request, and will drop the connection to avoid any potential HTTP pipelining issues.\n\n### References\n\nThis was mentioned in https://portswigger.net/research/http-desync-attacks-what-happened-next and was specifically mentioned as being an issue in HAProxy which did not properly filter it in this article: https://nathandavison.com/blog/haproxy-http-request-smuggling\n\n### Thanks\n\nThe Pylons Project would like to thank ZeddYu Lu for doing extended testing against Waitress 1.4.0 and bringing this to our attention!\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* open an issue at https://github.com/Pylons/waitress/issues (if not sensitive or security related)\n* email the Pylons Security mailing list: pylons-project-security@googlegroups.com (if security related)",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "waitress"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.4.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/security/advisories/GHSA-m5ff-3wj3-8ph4"
}, {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/commit/11d9e138125ad46e951027184b13242a3c1de017"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-444" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2019-12-26T16:34:06Z",
"nvd_published_at" : null
}
}