-
Notifications
You must be signed in to change notification settings - Fork 9
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
uhttpd incorrectly accepts empty header names. #5
Comments
IMHO it's not critical and from security perspective nothing bad should happen. According to a Postel Law we should accept this. |
The potential security problem is that some reverse proxies treat Other web servers (e.g. Nginx, Apache) don't allow empty header names, so clients don't produce them, so no compatibility is lost. The RFCs are pretty clear that header names must be nonempty. |
Thank you for the explanation. |
Introduce infrastructure and logic to perform less lenient parsing of HTTP request headers, chunk size headers and content-length values. We can not rely on `strtoul()` to parse hexadecimal chunk sizes or content length values as it accepts a wider range of inputs than what is allowed by the HTTP spec. Decode the chunk sizes and length values manually and fix skipping chunk extension headers while we're at it. Also ensure that there's no trailing garbage after the size and that we bail out on overflows. Also rework the parsing of request header lines, to reject malformed header lines or illegal header names. Fixes: openwrt#3 Fixes: openwrt#5 Signed-off-by: Jo-Philipp Wich <[email protected]> wip http parsing Signed-off-by: Jo-Philipp Wich <[email protected]>
Introduce infrastructure and logic to perform less lenient parsing of HTTP request headers, chunk size headers and content-length values. We can not rely on `strtoul()` to parse hexadecimal chunk sizes or content length values as it accepts a wider range of inputs than what is allowed by the HTTP spec. Decode the chunk sizes and length values manually and fix skipping chunk extension headers while we're at it. Also ensure that there's no trailing garbage after the size and that we bail out on overflows. Also rework the parsing of request header lines, to reject malformed header lines or illegal header names. Fixes: openwrt#3 Fixes: openwrt#5 Signed-off-by: Jo-Philipp Wich <[email protected]>
uhttpd accepts requests with empty header names. These are invalid according to the RFCs.
For example, uhttpd will accept the following request:
The text was updated successfully, but these errors were encountered: