]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: payload: reject a \0 byte in req.rdp_cookie
authorFrederic Lecaille <flecaille@haproxy.com>
Mon, 14 Sep 2026 09:48:52 +0000 (11:48 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Wed, 16 Sep 2026 07:18:10 +0000 (09:18 +0200)
commit1e1d8edd7c49ec10a6ad1815cabb1290bb11f330
tree0217dfc4caf917477f5d2d1a39f8fa24621adafb
parent4d8dd8459c4d654d9f7a2375a59ad5c3731736c5
BUG/MINOR: payload: reject a \0 byte in req.rdp_cookie

A string sample cannot contain a \0 byte, but req.rdp_cookie returned
the cookie value as found in the RDP packet, up to the CR, so a client
could put a \0 in it. Such a value was then matched by "-m str" on its
prefix: "public\0x" matched "public".

Stop parsing the cookie value on a \0 byte and fail the fetch, as for a
malformed cookie. The same function is used by the rdp-cookie
persistence, so such a cookie is not used as a key anymore either.

A reg-test is added to check that a "mstshash=public\0x" cookie does
not match "public".

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