Skip to content

h1: forbidden fields and unbounded count in chunked request trailers #1701

Closed

Description

@FlorentinDUBOIS

Found in the review of #1695. Measured on main at 9e55ad621db2a4f738f7a0ec54401f7f8e3e8291.

#1695 removes spoofable forwarding fields (X-Forwarded-*, Forwarded, X-Real-IP, X-Request-Id) from HTTP/1 chunked request trailers (elide_request_trailer_spoof_vectors in lib/src/protocol/kawa_h1/editor.rs). Every other trailer field is still forwarded verbatim, including fields RFC 9110 §6.5.1 forbids in trailers because they control framing, routing or authentication — Content-Length, Transfer-Encoding, Host, Authorization, Content-Type, etc. — and nothing bounds the number of trailer fields, unlike the H2 path which is capped by max_header_fields. The advisory Trailer: request header also still names fields that are now dropped.

Risk: a backend that merges trailers into headers can be fed framing or routing fields the client could not set in the header section; a client can send an unbounded number of trailer lines (bounded only by the buffer).

Proposal: drop (or reject) trailer fields that RFC 9110 §6.5.1 lists as not allowed in trailers on the H1 request path, apply a trailer field-count limit consistent with H2, and decide whether the Trailer: header should be pruned of dropped names. Tests: editor and e2e (backend must not receive the forbidden trailer fields; over-limit trailers are refused with a defined status).

Activity

  1. added a commit that references this issue on Sep 30, 2026
    864d707
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions