]> git.kaiwu.me - haproxy.git/commit
MINOR: mux-h2: pass the profile's HTTP hardening checks into the h2c and h2s
authorWilly Tarreau <w@1wt.eu>
Thu, 29 Oct 2026 16:14:35 +0000 (17:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Nov 2026 21:45:32 +0000 (22:45 +0100)
commitffb9641552281b36ab2f783351760023a65ef0ff
tree73ca4481477a7f2cf182f8733c3ae4ef66af4e2c
parent61e258598ad66e3b2439cf96878cbdf1b495d4d1
MINOR: mux-h2: pass the profile's HTTP hardening checks into the h2c and h2s

This adds an http_hardening profile pointer to h2c and an
http_hdng_chk into h2s. In h2_init() we preset the global hardening
profile depending on the side (note that the side might be reversed with
rhttp, but the pointer still points to a bind_conf or server so it remains
valid), and if no profile is found ("auto" or anything else) then we check
the source address to see if it's a non-local IPv4/v6, in which case we
use the untrusted profile, otherwise we fall back to the trusted one.

In h2s_new() we preset the h2s's hardening rules to the mask defined by
the profile pointed to by the h2c. This will be used as-is by the backend,
but in h2c_frt_handle_headers(), we have to preset the global hardening
profile to the h2c's mask before proceeding. If the stream is accepted
and created, we then copy what we collected to h2s for later consumption
(not implemented yet).
src/mux_h2.c