Skip to content

Improper handling of messages with both Transfer-Encoding and Content-Length headers #6

@kenballus

Description

@kenballus

When uhttpd receives a request with both a Transfer-Encoding: chunked and a Content-Length header, it prioritizes the Content-Length header. This is disallowed by RFC 9112, section 6.1:

A server MAY reject a request that contains both Content-Length and Transfer-Encoding or process such a request in accordance with the Transfer-Encoding alone. Regardless, the server MUST close the connection after responding to such a request to avoid the potential attacks.

I suggest that uhttpd respond 400 and close the connection in response to requests containing both headers. These requests are very uncommon and indicate a likely attempted request smuggling attack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions