CVE-2019-16789

7.1 HIGH

📋 TL;DR

CVE-2019-16789 is an HTTP request smuggling vulnerability in Waitress web server versions through 1.4.0. Attackers can send specially crafted requests with invalid whitespace in Transfer-Encoding headers that bypass front-end proxies and get parsed differently by Waitress, potentially leading to request splitting. This affects any deployment using Waitress behind a proxy server with HTTP pipelining enabled.

💻 Affected Systems

Products:
  • Waitress
Versions: All versions through 1.4.0
Operating Systems: All platforms running Waitress
Default Config Vulnerable: ⚠️ Yes
Notes: Requires Waitress behind a proxy server with HTTP pipelining enabled; standalone Waitress deployments are not vulnerable

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Cache poisoning leading to credential theft, session hijacking, or injection of malicious content to other users

🟠

Likely Case

Information disclosure through request splitting, potential for cache poisoning in vulnerable configurations

🟢

If Mitigated

Limited impact if proper proxy validation and request sanitization are in place

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires specific proxy configuration and knowledge of HTTP request smuggling techniques

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Waitress 1.4.1 and later

Vendor Advisory: https://docs.pylonsproject.org/projects/waitress/en/latest/#security-fixes

Restart Required: Yes

Instructions:

1. Upgrade Waitress to version 1.4.1 or later using pip: 'pip install waitress>=1.4.1' 2. Restart all Waitress services 3. Verify the upgrade with 'waitress-serve --version'

🔧 Temporary Workarounds

Disable HTTP Pipelining

all

Configure front-end proxy servers to disable HTTP pipelining to Waitress backend

# For nginx: proxy_http_version 1.0;
# For Apache: SetEnv proxy-nokeepalive 1

Strict Header Validation

linux

Configure proxy servers to reject requests with invalid whitespace in Transfer-Encoding headers

# Example nginx location block: if ($http_transfer_encoding ~* "[\t\n\r\f\v]") { return 400; }

🧯 If You Can't Patch

  • Deploy a WAF or reverse proxy with strict HTTP header validation in front of Waitress
  • Monitor for unusual HTTP request patterns and implement rate limiting

🔍 How to Verify

Check if Vulnerable:

Check Waitress version: 'waitress-serve --version' or 'pip show waitress' - if version is 1.4.0 or earlier, system is vulnerable

Check Version:

waitress-serve --version || python -c "import waitress; print(waitress.__version__)"

Verify Fix Applied:

Verify version is 1.4.1 or later and test with crafted requests containing whitespace in Transfer-Encoding headers

📡 Detection & Monitoring

Log Indicators:

  • Multiple requests from single connection with malformed Transfer-Encoding headers
  • Unexpected 400/500 errors from Waitress with unusual header patterns

Network Indicators:

  • HTTP requests with whitespace characters (\t, \n, \r, \f, \v) in Transfer-Encoding headers
  • Request splitting patterns in HTTP traffic

SIEM Query:

source="waitress.log" AND ("Transfer-Encoding" AND ("\t" OR "\n" OR "\r" OR "\f" OR "\v"))

🔗 References

📤 Share & Export