You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
h1: chunked trailers can carry spoofed forwarding headers #1689
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
fix(h1): drop spoofed forwarding headers from chunked request trailers
fix(h1): drop spoofed forwarding headers from chunked request trailers
fix(h1): drop spoofed forwarding headers from chunked request trailers (
fix(h1): drop forbidden fields from chunked request trailers and boun…