Dominik 9dec84ca42 fix: rand64() must share global outleft with rand16()/rand32()
rand64() declared its own `static int outleft`, shadowing the global
one while all three functions share the same out[] SURF output buffer.
When rand64() called surf() to refill out[], the global outleft still
indexed into the now-overwritten buffer, so subsequent rand32() or
rand16() calls could return the same words rand64() had already
consumed.  Drop the local static so all three functions coordinate
through the same counter.

Security: rand64() is used to generate DHCPv6 temporary address
interface IDs, which are visible on the local network.  Because of the
shared buffer issue, an observer could reconstruct the out[]
words consumed by rand64() and predict the next rand32() outputs.
rand32() drives the 0x20 case-scrambling bitmap used to harden DNS
queries against cache-poisoning, so this leaks PRNG state across the
DHCPv6 and DNS code paths. I'd still say the overall severity is rather
low as local network access required, and 0x20 encoding is really a
defence-in-depth and not some kind of essential security.

Signed-off-by: Dominik <dl6er@dl6er.de>
2026-03-30 17:33:08 +01:00
2012-04-02 20:40:34 +01:00
2025-12-07 13:44:40 +00:00
2012-01-05 17:31:15 +00:00
2018-01-14 17:32:52 +00:00
2022-05-13 21:22:11 +01:00
2012-01-05 17:31:13 +00:00
2025-07-20 15:29:43 +01:00
2021-06-15 23:14:59 +01:00
2025-01-23 17:08:39 +00:00
2025-07-20 15:29:43 +01:00
2024-12-18 23:58:58 +00:00
2012-01-05 22:00:08 +00:00
S
Description
No description provided
GPL-2.0
6.2 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 94.3%
Perl 2.2%
HTML 1.2%
Shell 1%
Makefile 0.6%
Other 0.6%