]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: payload: validate minimum keyshare_len in smp_fetch_ssl_keyshare_groups
authorWilly Tarreau <w@1wt.eu>
Wed, 29 Apr 2026 07:09:33 +0000 (09:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 29 Apr 2026 13:11:44 +0000 (15:11 +0200)
commit5cd666b0e3ca43d8d6311b902793666617665b31
tree061aab736d9359f6b39ea2362c1aa32a0050de55
parent57eed982f34af510eaaf981ddf21276ecfa73420
BUG/MINOR: payload: validate minimum keyshare_len in smp_fetch_ssl_keyshare_groups

The keyshare extension parsing loop reads dataPointer[readPosition+2]
and dataPointer[readPosition+3] inside the loop body, requiring at least
4 bytes to be safe. However, keyshare_len was only validated as >= 2.

With keyshare_len == 2 or 3, the first loop iteration would read past
the end of the extension data, causing an out-of-bounds read which is
harmless in practice. We also need to make sure that the read position
stops 4 bytes before the end in order to read the 4 next bytes.

This can be backported to stable versions.
src/payload.c