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 redrawBarForSubchart, redrawLineForSubchart and redrawAreaForSubchart(security vulnerability) #2874

Open
shubhamvinayak opened this issue Jan 20, 2023 · 2 comments

Comments

@shubhamvinayak
Copy link

  • C3 version: v7.0.0
  • D3 version: v5.0.0
  • Browser: Chrome
  • OS: Windows

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);
  1. redrawBarForSubchart: https://github.com/c3js/c3/blob/master/c3.esm.js#L12493
  2. redrawLineForSubchart: https://github.com/c3js/c3/blob/master/c3.esm.js#L12526
  3. redrawAreaForSubchart: https://github.com/c3js/c3/blob/master/c3.esm.js#L12562
@kondalraodurgam
Copy link

Facing same issue +1

@netil
Copy link

netil commented Feb 17, 2023

For those who are interested on, it has been applied to billboard.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants