/ go Public
crypto/rand: Read hangs when passed buffer larger than 1<<32 - 1 #52561
The path to resolution is known, but the work has not been done.
Passing a buffer larger than 1<<32 - 1 to
crypto/rand.Readhangs on windows due to an infinite loop because of how batching works with
RtlGenRandomonly supports reading at most 1<<32 - 1 bytes at a time,
rngReadertruncates the requested number of bytes to
len(b) % 1 << 32). After the first call, which will return
len(b) % 1 << 32bytes, the truncation will always result in 0, causing the infinite loop.
Since this requires such a large buffer, this has minimal impact, since it's incredibly unlikely anyone actually wants this much randomness (and there are no paths from the remotely reachable libraries where this can be realistically triggered.)
This is CVE-2022-30634.
The text was updated successfully, but these errors were encountered: