GHSA-m5ff-3wj3-8ph4: HTTP Request Smuggling Invalid Whitespace Characters Vulnerability

HIGH
CWE-444
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-m5ff-3wj3-8ph4
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
Affected Product HTTP Request Smuggling
Package Ecosystem PyPI
Published Date
Last Updated

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.

waitress fixed: 1.4.1
pip install waitress>=1.4.1
Verify Direct and Transitive Dependencies

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

### Impact If 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. ``` Content-Length: 10 Transfer-Encoding: [\x0b]chunked ``` For clarity: ``` 0x0b == vertical tab ``` Would 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. If 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. ### Patches Please upgrade to Waitress 1.4.1 which fixes this issue with stricter HTTP field validation. Waitress 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. ### Workarounds You may enable additional protections on front-end servers, those that follow RFC7230 correctly would drop the request with a 400 Bad Request. Waitress will now correctly responds to the request with a 400 Bad Request, and will drop the connection to avoid any potential HTTP pipelining issues. ### References This 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 ### Thanks The Pylons Project would like to thank ZeddYu Lu for doing extended testing against Waitress 1.4.0 and bringing this to our attention! ### For more information If you have any questions or comments about this advisory: * open an issue at 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)

GHSA-m5ff-3wj3-8ph4 Affected HTTP Request Smuggling Versions

1 component(s)
Fixed Versions:
1.4.1
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?
GHSA-m5ff-3wj3-8ph4 is a security vulnerability in HTTP Request Smuggling involving Invalid whitespace characters in headers in Waitress under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling').
Which HTTP Request Smuggling versions are affected?
Affected versions include releases prior to 1.4.1 across affected packages: waitress.
What version fixes GHSA-m5ff-3wj3-8ph4?
Upgrading to 1.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is waitress affected?
Yes, waitress is affected in releases prior to 1.4.1. Upgrade your dependency to 1.4.1 or later.
What CWE is associated with GHSA-m5ff-3wj3-8ph4?
GHSA-m5ff-3wj3-8ph4 is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') (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.).
How can I check PyPI dependencies for GHSA-m5ff-3wj3-8ph4?
Run the dependency tree command: 'pip show waitress'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}