Skip to content
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

Insecure Randomness for the useof Math.random() in shuffle API (security vulnerability) #268

Closed
shubhamvinayak opened this issue Jan 20, 2023 · 1 comment

Comments

@shubhamvinayak
Copy link

Since Math.random could potentially return the same value twice and it is not cryptographically secure causing the insecure randomness when we scan the code in the fortify tool.

Please confirm if there is any future plan to remove Math.random and use cryptographically secure code for getting random values.
just by using crypto API

const myArray = new Uint32Array(10);
crypto.getRandomValues(myArray);

https://github.com/d3/d3-array/blob/main/src/shuffle.js#L1

@Fil
Copy link
Member

Fil commented Jan 20, 2023

You can pass a source of your liking to d3.shuffler.

Same issue as d3/d3-random#45

@Fil Fil closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants