Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Make UUIDs unpredictable #2299

Closed
mozfreddyb opened this issue Mar 7, 2017 · 6 comments
Closed

Make UUIDs unpredictable #2299

mozfreddyb opened this issue Mar 7, 2017 · 6 comments
Labels
good first issue security Security issue: can be an active issue, or related to security hygene

Comments

@mozfreddyb
Copy link

Pageshot's current UUID implementations [1] [2] use Math.random to generate UUIDs.
This method produces predictable IDs and someone could compute your next UUIDs based on previous. This might allow an attacker to crawl all shots.

I'm not sure how bad this is for your threat model (probably not so bad?), but I wanted to make sure this is noted.

@jvehent jvehent added the security Security issue: can be an active issue, or related to security hygene label Mar 7, 2017
@ianb
Copy link
Contributor

ianb commented Mar 7, 2017

I actually had your notes from this somewhere but can't find them now, and forgot to make a ticket. Since the unguessability of these strings is important we should make this change.

We should also change randomString.js, and do a search for Math.random in case there's another instance I've forgotten.

@jaredhirsch
Copy link
Member

crypto.getRandomValues() should work in a worker or a regular DOM page: https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues

@mozfreddyb
Copy link
Author

mozfreddyb commented Mar 7, 2017 via email

@ianb
Copy link
Contributor

ianb commented Mar 7, 2017

Ah, I threw it in a comment on a not-very-related bug: #2139 (comment)

@ianb ianb added this to the Page Shot in 54 milestone Mar 8, 2017
@jaredhirsch
Copy link
Member

Closed by #2404 (thanks, @garbados!)

@garbados
Copy link
Contributor

Heck, glad to help :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue security Security issue: can be an active issue, or related to security hygene
Projects
None yet
Development

No branches or pull requests

5 participants