Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty header names are improperly permitted #1797

Closed
kenballus opened this issue Jun 28, 2024 · 2 comments
Closed

Empty header names are improperly permitted #1797

kenballus opened this issue Jun 28, 2024 · 2 comments

Comments

@kenballus
Copy link

kenballus commented Jun 28, 2024

RFC 9110 specifies that header field names must be nonempty:

field-name = token
token = 1*tchar

FastHTTP does not enforce this rule, and allows empty header names.

For example, FastHTTP accepts the following request:

GET / HTTP/1.1\r\n
Host: a\r\n
: no-name\r\n
\r\n
\r\n

In the past, empty header names have been used to execute request smuggling attacks, due to the fact that some gateways have historically treated \r\n:\r\n equivalently to \r\n\r\n.

Most HTTP servers (including AIOHTTP, Apache, Daphne, Deno, Go net/http, Gunicorn, H2O, HAProxy, Hyper, Hypercorn, Jetty, Lighttpd, Nginx, Node.js, LiteSpeed, Passenger, Puma, Tomcat, Unicorn, Uvicorn, Waitress, and WEBrick) reject requests containing empty header names. FastHTTP should probably do the same.

@erikdubbelboer
Copy link
Collaborator

This is also getting fixed in #1796 can you have a look?

@erikdubbelboer
Copy link
Collaborator

Fixed in #1796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants