CVE-2020-36732: Crypto js Crypto-js Uses Insecure Random Numbers Vulnerability

MODERATE
Advisory Identifier: GHSA-3w3w-pxmm-2w2j
CVSS 5.3
CWE-331 CWE-330
Published
Advisory Summary

CVE-2020-36732 is a MODERATE (CVSS 5.3) crypto-js uses insecure random numbers vulnerability (CWE-331: Insufficient Entropy) affecting Crypto js libraries in the npm ecosystem. The issue involves crypto-js uses insecure random numbers. Remediation is available by upgrading affected packages to version 3.2.1.

CVE-2020-36732 at a Glance

CVE Identifier CVE-2020-36732
GHSA Identifier GHSA-3w3w-pxmm-2w2j
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-331: Insufficient Entropy
Affected Product Crypto js
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2020-36732

To remediate this vulnerability, upgrade all affected Crypto js dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

crypto-js fixed: 3.2.1
npm install crypto-js@3.2.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls crypto-js

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2020-36732, inspect your project dependencies using npm:

npm ls crypto-js

Analyze the terminal output to locate any version of Crypto js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.1), your application is affected.

Note: The npm ls crypto-js command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-331: Insufficient Entropy, where the product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others. In Crypto js, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The crypto-js package 3.2.0 for Node.js generates random numbers by concatenating the string "0." with an integer, which makes the output more predictable than necessary.

CVE-2020-36732 Affected Crypto js Versions

1 component(s)
Fixed Versions:
3.2.1
Product / Package Ecosystem Affected Versions Fixed Version
crypto-js
npm
≥ 3.2.0
< 3.2.1
All 1 versions
3.2.0
3.2.1

References

Frequently Asked Questions

What is CVE-2020-36732?
CVE-2020-36732 is a security vulnerability in Crypto js involving crypto-js uses insecure random numbers under CWE-331: Insufficient Entropy.
Which Crypto js versions are affected?
Affected versions include releases prior to 3.2.1 across affected packages: crypto-js.
What version fixes CVE-2020-36732?
Upgrading to 3.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is crypto-js affected?
Yes, crypto-js is affected in releases prior to 3.2.1. Upgrade your dependency to 3.2.1 or later.
What is the CVSS score of CVE-2020-36732?
CVE-2020-36732 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2020-36732?
CVE-2020-36732 is classified under CWE-331: Insufficient Entropy (The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.).
How can I check npm dependencies for CVE-2020-36732?
Run the dependency tree command: 'npm ls crypto-js'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3w3w-pxmm-2w2j",
  "modified" : "2026-03-16T21:31:59Z",
  "published" : "2023-06-12T03:30:17Z",
  "aliases" : [ "CVE-2020-36732" ],
  "summary" : "crypto-js uses insecure random numbers",
  "details" : "The crypto-js package 3.2.0 for Node.js generates random numbers by concatenating the string \"0.\" with an integer, which makes the output more predictable than necessary.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "crypto-js"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.0"
      }, {
        "fixed" : "3.2.1"
      } ]
    } ],
    "versions" : [ "3.2.0" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-36732"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brix/crypto-js/issues/254"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brix/crypto-js/issues/256"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brix/crypto-js/pull/257/commits/e4ac157d8b75b962d6538fc0b996e5d4d5a9466b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brix/crypto-js/commit/b405ff597fb3ac76a7bdfbc72dca10ba1079b1d5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brix/crypto-js/commit/e4ac157d8b75b962d6538fc0b996e5d4d5a9466b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/brix/crypto-js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brix/crypto-js/compare/3.2.0...3.2.1"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20230706-0003"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-CRYPTOJS-548472"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-330", "CWE-331" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-13T12:44:48Z",
    "nvd_published_at" : "2023-06-12T02:15:48Z"
  }
}