Open kenballus opened 5 months ago
Other WSGI servers either automatically close the connection upon receipt of requests with invalid chunked message bodies (Waitress, Tornado) or close the connection automatically when a 400 response is sent manually (gunicorn).
β I'm submitting a ...
π Describe the bug. What is the current behavior? When a Cheroot-based WSGI server receives a request with an invalid chunked message body, it raises an exception upon attempting to access
environ["wsgi.input"]
. Unless I'm mistaken, the issue with this approach is twofold:environ["wsgi.input"]
is never accessed, then the second request in a pipeline is assumed to be immediately following the end of headers of the first request. This leads to framing problems.β What is the motivation / use case for changing the behavior? Prevention of request smuggling.
π‘ To Reproduce Steps to reproduce the behavior:
wsgi.input
outside of atry
block.try
block around the access towsgi.input
, and respond 400 in theexcept
block.π‘ Expected behavior Requests with invalid chunked message bodies should get 400s.
π Environment