]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: peers: trim received string keys to fit in a buffer
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 18 Nov 2026 10:02:39 +0000 (11:02 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 18 Nov 2026 15:33:22 +0000 (16:33 +0100)
commitacc8202ebf83c11a6d90320154c6a37b9d65bde1
tree0db3d3bc976908b5f11d547f66ee36331013e5a4
parent854701a3395519ef3d86c51f508698b7b582b0e8
BUG/MEDIUM: peers: trim received string keys to fit in a buffer

Commit b224f63c1 ("BUG/MEDIUM: stick-table: restrict key sizes to what
fits in a buffer") trims string keys in stksess_setkey() so that the
update message fits in a buffer, but string keys received from a peer
are copied directly and only bounded by the table's key size. A peer
with a larger bufsize, or a forged message, can thus store a key which
cannot be encoded when it is later taught to another peer. Since commit
ef4405d67 ("BUG/MEDIUM: peers: bound stick-table update messages") this
does not overflow the trash buffer anymore, but the peer session is
closed and reopened in loop and the resync never completes, as reported
in GitHub issue #3576.

Let's apply the same trimming on the receive path. This must be
backported wherever b224f63c1 was.
src/peers.c