Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Insecure Randomness for the useof Math.random() in redrawBarForSubchart, redrawLineForSubchart and redrawAreaForSubchart(security vulnerability) #2874

Copy link
Copy link
@shubhamvinayak

Description

@shubhamvinayak
Issue body actions
  • 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
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.