CVE-2017-16028: Randomatic Cryptographically Weak PRNG Vulnerability

MODERATE
Advisory Identifier: GHSA-6g33-f262-xjp4
CVSS 5.3
CWE-338 CWE-330
Published
Advisory Summary

CVE-2017-16028 is a MODERATE (CVSS 5.3) cryptographically weak prng vulnerability (CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)) affecting Randomatic libraries in the npm ecosystem. The issue involves cryptographically weak prng in randomatic. Remediation is available by upgrading affected packages to version 3.0.0.

CVE-2017-16028 at a Glance

CVE Identifier CVE-2017-16028
GHSA Identifier GHSA-6g33-f262-xjp4
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
Affected Product Randomatic
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.0/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-2017-16028

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

randomatic fixed: 3.0.0
npm install randomatic@3.0.0
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 randomatic

How to Check if You Are Affected

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

npm ls randomatic

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

Note: The npm ls randomatic 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-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG), where the product uses a pseudo-random number generator (prng) in a security context, but the prng's algorithm is not cryptographically strong. In Randomatic, 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

Affected versions of `randomatic` generate random values using a cryptographically weak psuedo-random number generator. This may result in predictable values instead of random values as intended. ## Recommendation Update to version 3.0.0 or later.

CVE-2017-16028 Affected Randomatic Versions

1 component(s)
Fixed Versions:
3.0.0
Product / Package Ecosystem Affected Versions Fixed Version
randomatic
npm
< 3.0.0
3.0.0

References

Frequently Asked Questions

What is CVE-2017-16028?
CVE-2017-16028 is a security vulnerability in Randomatic involving Cryptographically Weak PRNG in randomatic under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG).
Which Randomatic versions are affected?
Affected versions include releases prior to 3.0.0 across affected packages: randomatic.
What version fixes CVE-2017-16028?
Upgrading to 3.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is randomatic affected?
Yes, randomatic is affected in releases prior to 3.0.0. Upgrade your dependency to 3.0.0 or later.
What is the CVSS score of CVE-2017-16028?
CVE-2017-16028 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2017-16028?
CVE-2017-16028 is classified under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) (The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG's algorithm is not cryptographically strong.).
How can I check npm dependencies for CVE-2017-16028?
Run the dependency tree command: 'npm ls randomatic'. 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-6g33-f262-xjp4",
  "modified" : "2023-09-08T20:56:26Z",
  "published" : "2018-10-09T00:57:21Z",
  "aliases" : [ "CVE-2017-16028" ],
  "summary" : "Cryptographically Weak PRNG in randomatic",
  "details" : "Affected versions of `randomatic` generate random values using a cryptographically weak psuedo-random number generator. This may result in predictable values instead of random values as intended.\n\n\n\n\n## Recommendation\n\nUpdate to version 3.0.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "randomatic"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-16028"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jonschlinkert/randomatic/commit/4a526959b3a246ae8e4a82f9c182180907227fe1#diff-b9cfc7f2cdf78a7f4b91a753d10865a2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-6g33-f262-xjp4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tableflip/react-native-meteor-oauth/blob/a7eb738b74c469f5db20296b44b7cae4e2337435/src/meteor-oauth.js#L66"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/157"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-330", "CWE-338" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:19:13Z",
    "nvd_published_at" : null
  }
}