-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite loop in randomInt
#137
Comments
Some details on the probability of infinite loop: https://functor.network/user/790/entry/270#the-exploit |
Thank for your thorough audit. I'll implement your suggestion, it does look like I made a mistake in not advancing state. I am not so certain of a DoS vulnerability, but if you could provide an initState, streamID, and with which provided output function it exists that the second state is 0, I would love to add it as a test case. |
The
randomInt()
function loops infinitely under certain conditions, this is a serious DoS vulnerability.The loop in
randomInt()
always uses the state value that never changes, so if a resulting value fails the threshold test only once, the loop will repeat forever.It should rather be something like
n = pcg.getOutput(nextPcg.state)
, so that the current state is used, not the initial one.The text was updated successfully, but these errors were encountered: