Skip to content

net/http: be stricter about framing-related headers #81595

Open

Description

@nicholashusin

This is a follow up to #81115.

#81115 describes an issue where:

  1. A server sends multiple conflicting Content-Length headers.
  2. A reverse proxy, using our HTTP/2 transport implementation, accepts the headers and passes them along to the client (normally, this is okay to do since HTTP/2 framing does not rely on Content-Length headers).
  3. An HTTP/1 client, which improperly accepts multiple Content-Length headers (our HTTP/1 transport does not), is now vulnerable to response smuggling.

After #81115, our HTTP/2 transport will no longer forward multiple Content-Length headers, just in case we are forwarding to an HTTP/1 implementation that might be vulnerable to response smuggling.

However, it might be beneficial for us to be stricter about framing-related headers in general:

  1. Our server should not send an HTTP/1 response containing multiple Content-Length headers.
  2. Consider similar scenarios with non-canonical (e.g., content-length rather than Content-Length).
  3. Consider similar scenarios with Transfer-Encoding.

A dedicated attacker can always directly send invalid framing-related headers to the wire regardless of our implementation. But, this can prevent cases where someone using our server accidentally sends bad headers.

Activity

  1. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Sep 18, 2026
  2. added this to the Go1.28 milestone on Sep 18, 2026
  3. yungchoppa commented on Sep 21, 2026

    @yungchoppa

    Hi! I’d like to work on this issue. I’ll investigate the current framing header validation in net/http and prepare a patch

  4. gopherbot commented on Sep 22, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/836605 mentions this issue: net/http: be stricter about framing-related headers in HTTP/1 server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions