Roundup Tracker - Issues


Author rouilj
Recipients cmeerw, rouilj
Date 2018-08-02.21:45:50
Message-id <20180802214532.66AF84C0271@itserver6.localdomain>
In-reply-to <>
Hi Christof:

In message <>,
Christof Meerwald writes:
>New submission from Christof Meerwald:
>When SystemRandom is not available, we try to
>  from random import random
>and then use "random.random()" - but this fails as we have only 
>imported the random function, not the module.

That's probably code that never gets tested. Adding a test to generate
the needed exception would be good.

>In we use os.urandom (for SSHA) without checking if it is 

Wow, yeah that would generate a nice exception at the very least.
Question, does the salt needs to be generated using os.urandom at all?
Everything else in that module seems to use just random. Is the
randomness of the salt that critical?

>The places where we reseed the random number generator seem to be a 
>bit, well, random. We should probably only reseed after forking, i.e. 
>in ForkingServer (

There are at least 5 deployment mechanisms for roundup (see "Configure
a Web Interface" in doc/installation.txt . Only one of which is the
server. What happens when roundup is used as a cgi or under
mod_python, zope or wsgi? Cgi is probably ok since we get a default
seed when the process is started that is thrown away when the process
exits. But mod_python, wsgi and zope are IIUC long lived processes
which do not go through scripts/, but do go through
the cgi/ module which is where I did the seeding.

I think the seeding there isn't the best as in theory the seeding data
source could be known (IIRC it's the timestap when seed is
called). That could be known by an attacker as it is some small window
around the time of the http request. It would probably be better
to mix in some state derived from all prior interactions with the
server. But I didn't have the knowledge to make that happen.

>And finally, Python 3.6 provides a secrets module - we should probably 
>use that, if available, and fall back to SystemRandom/os.urandom and 
>finally just the random module.

That sounds like a good idea. Just make sure that every execution
path for all deployment methods runs through the module.
Date User Action Args
2018-08-02 21:45:51rouiljsetrecipients: + rouilj, cmeerw
2018-08-02 21:45:51rouiljlinkissue2550988 messages
2018-08-02 21:45:50rouiljcreate