You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
β question about the decisions made in the repository
π Describe the bug. What is the current behavior?
When Cheroot receives a header field value that begins and/or ends with any number of \x0b, \x0c, or \x0d bytes, it strips them off. While the RFC does require the stripping of optional whitespace on either side of header values, this includes only SP and HTAB bytes.
β What is the motivation / use case for changing the behavior?
RFC compliance and avoidance of framing-related issues.
π‘ To Reproduce
Steps to reproduce the behavior:
Start a Cheroot-based HTTP server that echos the headers. (e.g., this one)
Send it a request prefixed and suffixed with the aforementioned bytes, and extract the header value:
Observe that the \x0b, \x0c, and \x0d bytes were stripped:
00000000: 7465 7374 test
π‘ Expected behavior
The RFCs permit two behaviors:
Reject the request, since these characters are not permitted within header values.
AIOHTTP, Apache, Deno, FastHTTP, Go net/http, H2O, HAProxy, Hyper, Hypercorn, Jetty, Libevent, Lighttpd, Mongoose, Netty, Nginx, Node.js, Passenger, Puma, Tomcat, Uvicorn, Waitress, and WEBrick do this.
Translate the \x0d into SP, then process the request, appropriately stripping SP bytes (including those just created) and allowing \x0b and \x0c to stay in the value.
Libsoup, LiteSpeed, and Twisted do this.
π Environment
Cheroot version: 10.0.2.dev71+g1ff20b18
Python version: 3.11.9
OS: Linux 3dd8401f8901 6.9.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 28 Jun 2024 04:32:50 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
kenballus
changed the title
Cheroot incorrectly strips \x0b, \x0c, and \x0d from the beginnings and ends of header names.
Cheroot incorrectly strips \x0b, \x0c, and \x0d from the beginnings and ends of header values.
Jul 15, 2024
β I'm submitting a ...
π Describe the bug. What is the current behavior?
When Cheroot receives a header field value that begins and/or ends with any number of
\x0b
,\x0c
, or\x0d
bytes, it strips them off. While the RFC does require the stripping of optional whitespace on either side of header values, this includes only SP and HTAB bytes.β What is the motivation / use case for changing the behavior?
RFC compliance and avoidance of framing-related issues.
π‘ To Reproduce
Steps to reproduce the behavior:
\x0b
,\x0c
, and\x0d
bytes were stripped:π‘ Expected behavior
The RFCs permit two behaviors:
\x0d
into SP, then process the request, appropriately stripping SP bytes (including those just created) and allowing\x0b
and\x0c
to stay in the value.π Environment
Linux 3dd8401f8901 6.9.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 28 Jun 2024 04:32:50 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: