]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: init: use more than ha_random64() for the cluster secret
authorWilly Tarreau <w@1wt.eu>
Sun, 24 May 2026 09:06:31 +0000 (11:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 May 2026 08:52:42 +0000 (10:52 +0200)
commit7d182a2ed5c6489314da339e832534b28281bbd9
tree5d58809324b7dc105129dec6774cb7e6e4340e71
parentc0e302fe79a127e7093a14757351e85cfba20b24
BUG/MINOR: init: use more than ha_random64() for the cluster secret

When not set, the cluster secret is randomly generated by two
consecutive calls to ha_random64(). However, the random64 PRNG may be
partially observed on a fully idle machine (QUIC retry tokens, UUID,
WS key), and it could be rolled back to the initial call that produced
the secret. This is purely theoretical as a normally loaded system
wouldn't reveal meaningful sequences, but better address this while
it's still easy.

The first here consists in isolating the cluster_secret from the PRNG
sequence. When RAND_bytes() is available and works, it's used. Otherwise
ha_random64() is mixed with uncorrelated bits from random().

This could be backported to stable releases.
src/haproxy.c