]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: peers: enforce check on incoming table key type
authorWilly Tarreau <w@1wt.eu>
Thu, 19 Mar 2026 05:58:14 +0000 (06:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Mar 2026 06:03:10 +0000 (07:03 +0100)
commit1696cfaa195f291bb92439405207389135e6c085
treea2741572f5391e301de7e7d8642802f0bd5302dd
parentc6221db375f1099aef4127dede6f583c413a9a82
BUG/MEDIUM: peers: enforce check on incoming table key type

The key type received over the peers protocol is not checked for
validity and as a result can crash the process when passed through
peer_int_key_type[] in peer_treat_definemsg(). The risk remains
very low since only trusted peers may exchange tables, however it
represents a risk the day haproxy supports new key types, because
mixing old and new versions could then cause the old ones to crash.
Let's add the required check in peer_treat_definemsg().

It is also worth noting that in this function a few protocol identifiers
of type int read directly from a var_int via intdecode() and that some
protocol aliasing may occur (e.g. table_id, table_id_len etc). This is
not supposed to be a problem but it could hide implementation bugs and
cause interoperability issues once fixed, so these should be addressed
in a future commit that will not be marked for backporting.

Thanks to Haruto Kimura (Stella) for finding and reporting this bug.

This fix needs to be backported to all stable versions.
src/peers.c