]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: payload: reject a \0 byte in req.ssl_sni and req.ssl_alpn
authorFrederic Lecaille <flecaille@haproxy.com>
Tue, 15 Sep 2026 09:04:51 +0000 (11:04 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Wed, 16 Sep 2026 07:18:11 +0000 (09:18 +0200)
commit96bb716af7b0c53aeee8bd6546276b54152a97ce
tree8854871266fb897f39a3a1dc456a16fd106c81f2
parent490ab4983a3c620e24531f46fa6b06d55fdf5580
BUG/MINOR: payload: reject a \0 byte in req.ssl_sni and req.ssl_alpn

A string sample cannot contain a \0 byte, but req.ssl_sni and
req.ssl_alpn returned the server name and the protocol names as found
in the raw ClientHello, so a client could put a \0 in them. Such a
value was then matched by "-m str" on its prefix: "public\0x" matched
"public".

Fail the fetch when the name holds a \0 byte, as for a malformed
ClientHello.

A reg-test is added to check that a "public\0x" server name or ALPN
protocol name does not match "public".

This must be backported to all stable branches.
reg-tests/sample_fetches/ssl_hello_embedded_nul.vtc [new file with mode: 0644]
src/payload.c