]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: payload: fix the handshake length bounds check smp_client_hello_parse()
authorWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 07:06:03 +0000 (09:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 11:13:24 +0000 (13:13 +0200)
commit2653936510002991841eb1abcef5c24e0588346f
treeefc906829ec781f0a0b70997a3c717525deb20a8
parent997c99df9c7957071d0e63d0c98f2f07ef013580
BUG/MINOR: payload: fix the handshake length bounds check smp_client_hello_parse()

After reading the handshake length, which is covered by the previous
4 bytes check, the size was not subtracted before being compared to the
retrieved handshake length, making it possible to accept a handshake
that claims to be 4 bytes larger than it really is. Similarly, a few
lines later, data[34] is accessed without checking that it is present,
because the test is made on the second hs_len, which doesn't guarantee
that the data are there.

This fix adds both tests. It can be backported to all stable versions
as it was introduced in 1.6 with commit bb2acf589f ("MINOR: payload:
add support for tls session ticket ext").
src/payload.c