]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: sample: reject a \0 byte in raw string fetches
authorGihyeon Ryu <rlgusryu@gmail.com>
Wed, 11 Nov 2026 10:00:12 +0000 (10:00 +0000)
committerOlivier Houchard <cognet@ci0.org>
Fri, 13 Nov 2026 15:55:27 +0000 (16:55 +0100)
commitd5695eaff8cabe88c422176c69512a802fbcc5d0
tree09563434085382250fec0ae9dd673d05945e00e0
parent42ef0b23e5e0761f1546a83ecc73c8035dc003a0
BUG/MINOR: sample: reject a \0 byte in raw string fetches

These fetches return a string pointing to the raw client data, which may
contain a \0 byte, while string consumers rely on it not happening
(37204a71a). The pattern tree lookup used by case-sensitive "-m str"
matches and by maps stops at this byte, so "user\0admin" matches "user",
while the next hop sees the whole value. A rule based on these fetches
can then be bypassed.

req.ssl_sni and req.rdp_cookie now fail on such a value, and
req.ssl_alpn and req.body_param skip it and report the next one.
Legitimate values never contain a \0.

The reg-test str_embedded_nul.vtc covers it.

This should be backported along with 37204a71a.
reg-tests/sample_fetches/str_embedded_nul.vtc [new file with mode: 0644]
src/http_fetch.c
src/payload.c