Skip to content

h1: chunked trailers can carry spoofed forwarding headers #1689

Closed

Description

@FlorentinDUBOIS

Found during review of #1685. Measured on main at 3ed6e8a61974b9b1847a9571948cfdea8fabb078.

For H2 frontends, pkawa::handle_trailer (lib/src/protocol/mux/pkawa.rs) drops forwarding headers a client could use to spoof its origin when they appear in a trailer section (x-real-ip, x-forwarded-for, forwarded; #1685 extends the list to x-forwarded-proto/-port/-host). The H1 path has no equivalent: the request editor in lib/src/protocol/kawa_h1/editor.rs only rewrites the header block, and chunked trailers are forwarded as received (found by reading; not yet reproduced).

Effect: an HTTP/1.1 client sending a chunked body can append X-Forwarded-For, Forwarded or X-Real-IP as trailer fields; a backend that merges trailers into headers can then see a forged client address, bypassing the header-side handling (and the forwarded_headers modes of #1685).

Fix: apply the same drop list to H1 chunked trailers (one shared list for both paths), with an editor test and an e2e test (H1 chunked request with spoofed trailers, backend must not receive them). First confirm with a reproduction.

Activity

  1. added 2 commits that reference this issue on Sep 29, 2026
    d7da4e6
    0f87745
  2. added a commit that references this issue on Sep 29, 2026
    67e5bf2
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