CVE-2020-36732: brix crypto-js insecure random number generation

CVE-2020-36732 · Severity: low · CVSS 3.1 · Published 2023-06-12

The crypto-js library, a popular tool for implementing encryption in JavaScript applications, was found to use an insecure method for generating random numbers. This flaw makes the resulting cryptographic keys or tokens more predictable than they should be. An attacker could potentially exploit this predictability to bypass security measures or decrypt sensitive information. Organizations using version 3.2.0 should update to a newer version to ensure their data remains protected by strong, unpredictable encryption.

Technologies: crypto-js (npm). Vendors: npm.

Quick answers

Is CVE-2020-36732 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2020-36732 being exploited in the wild.
How severe is CVE-2020-36732?
Low severity, with a CVSS score of 3.1, published 12 June 2023.
Which products and versions are affected?
crypto-js (npm) SEMVER:introduced=3.2.0,fixed=3.2.1.
Is there a fix for CVE-2020-36732?
Yes. crypto-js (npm): upgrade to 3.2.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2020-36732 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2020-36732?
Check whether you run crypto-js (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • crypto-js (npm): upgrade to 3.2.1 or later
    npm install crypto-js@3.2.1

Technical details

The crypto-js package version 3.2.0 for Node.js contains a vulnerability where random numbers are generated using an insecure method (CWE-330). Specifically, the library attempted to generate random values by concatenating the string '0.' with an integer, which results in insufficient entropy and predictable outputs compared to cryptographically secure pseudo-random number generators (CSPRNG). This predictability can weaken cryptographic operations that rely on randomness, such as key generation or initialization vectors. The issue was addressed in version 3.2.1 by implementing a more robust random number generation strategy that leverages native crypto modules where available.

Affected products

  • brix crypto-js 3.2.0

Identifiers

  • CVE-2020-36732
  • GHSA-3w3w-pxmm-2w2j

Timeline

  • 2020-01-30: disclosed: Issue reported to maintainers via GitHub and email
  • 2020-02-11: patched: Fix committed to repository
  • 2023-06-12: advisory: GitHub Advisory and CVE published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.