[New-bugs-announce] [issue27288] secrets should use getrandom() on Linux

Donald Stufft report at bugs.python.org
Fri Jun 10 15:56:39 EDT 2016

New submission from Donald Stufft:

In 3.5.0 and 3.5.1 os.urandom will, where available, use the getrandom() to block rather than get insecure random from the urandom pool on Linux. In 3.5.2 this change is reverted so that os.urandom will return possibly predictable random numbers instead of blocking waiting for /dev/urandom to be intialized.

However, secrets.py is a module which is explicitly for getting cryptographically safe data for, and reverting that change means that the functions in this module are no longer cryptographically safe on Linux if they are called early enough in the boot process. Thus, secrets.py should be modified so that it no longer uses os.urandom on systems where there is a better source of randomness available-- namely getrandom() set to block on Linux.

messages: 268147
nosy: brett.cannon, dstufft, ned.deily
priority: release blocker
severity: normal
status: open
title: secrets should use getrandom() on Linux
type: security
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list