arik-so / arik-so/tsa

Math.random() is not cryptographically secure

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
59
Forks
6
PR merge metrics
No merged PRs in 30d

Description

For something where you don't want a possible attacker to have any knowledge of the upcoming lane, the randomizer needs to be cryptographically secure.

Thankfully, this is easy to fix by just using https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues instead of Math.random().

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the randomizer code that calls Math.random() and read how the upcoming lane is selected. Use the browser RandomSource/getRandomValues API described in the issue, then verify that lane generation no longer relies on Math.random().

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.