]> git.kaiwu.me - haproxy.git/commit
MEDIUM: http/hardening: reject forbidden payload on 1xx/204 responses
authorWilly Tarreau <w@1wt.eu>
Mon, 23 Nov 2026 12:39:03 +0000 (13:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Nov 2026 22:24:23 +0000 (23:24 +0100)
commitc157dfefb495aba3982d4f6e2d74cc5f2599f193
tree70595ec5323e916f009a773139c944369f13b6d7
parentd35887c6d1da762dae6f6f5208375058d9e32513
MEDIUM: http/hardening: reject forbidden payload on 1xx/204 responses

When a content-length greater than zero or a transfer-encoding header
are presented with responses that may not contain any body, the new
hardening rule "reject-forbidden-payload" will block them to limit the
risk of attacks (e.g. cache poisonning). It is enabled by default on
untrusted connections.

For h2 and h3 it's not easy to test. haproxy was used with an
http-request return action for this, along with a code modification
in http_parse_http_reply() to disable the 204+CL check.
doc/configuration.txt
include/haproxy/http-t.h
reg-tests/http-messaging/http_hardening_profiles.vtc
src/h1_htx.c
src/h2.c
src/h3.c
src/http.c