Conversation
…rom timestamp ## The problem GenerateShortEventId used math/rand with unix timestamp of the event creation as the seed, which is predictable and deterministic. Also, the shortId space with only a length of 5 chars can be enumerated, leaving the privacy of events at risk. ## The fix This commit changes the ShortId generation from math/rand to crypto/rand to generate a 10-char long random id for an event, and stop using the timestamp as seed to prevent malicious guessing. This, however, should be implemented in tandem with rate limiting to truly prevent the enumeration risk. Another PR will be opened later to address the problem.
Member
|
The reason why we initially implemented the short IDs was because we wanted to provide an easy way for someone to share a link on a whiteboard / so it was easy to manually type. Maybe a better solution is to just implement rate limiting so someone can't just run a script to discover a bunch of event IDs? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…rom timestamp
The problem
GenerateShortEventId used math/rand with unix timestamp of the event creation as the seed, which is predictable and deterministic. Also, the shortId space with only a length of 5 chars can be enumerated, leaving the privacy of events at risk.
The fix
This commit changes the ShortId generation from math/rand to crypto/rand to generate a 10-char long random id for an event, and stop using the timestamp as seed to prevent malicious guessing. This, however, should be implemented in tandem with rate limiting to truly prevent the enumeration risk. Another PR will be opened later to address the problem.