Vulnerabilities in pkg:npm/generate-password

PACKAGE
Advisory Summary

GHSA-6qqf-vvcr-7qrv is a MODERATE cryptographically weak prng vulnerability (CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)) affecting Generate password libraries in the npm ecosystem. The issue involves cryptographically weak prng in generate-password. Remediation is available by upgrading affected packages to version 1.4.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/generate-password

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/generate-password. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6qqf-vvcr-7qrv - MODERATE Cryptographically Weak PRNG in generate-password

GHSA-6qqf-vvcr-7qrv at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-6qqf-vvcr-7qrv
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
Affected Product Generate password
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-6qqf-vvcr-7qrv

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

generate-password fixed: 1.4.1
npm install generate-password@1.4.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 generate-password

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-6qqf-vvcr-7qrv, inspect your project dependencies using npm:

npm ls generate-password

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

Note: The npm ls generate-password 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 Generate password, 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 generate-password generate random values that are biased towards certain characters depending on the chosen character sets. This may result in guessable passwords. ## Recommendation Update to version 1.4.1 or later.

GHSA-6qqf-vvcr-7qrv Affected Generate password Versions

1 component(s)
Fixed Versions:
1.4.1
Product / Package Ecosystem Affected Versions Fixed Version
generate-password
npm
< 1.4.1
1.4.1

References

Frequently Asked Questions

What is GHSA-6qqf-vvcr-7qrv?
GHSA-6qqf-vvcr-7qrv is a security vulnerability in Generate password involving Cryptographically Weak PRNG in generate-password under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG).
Which Generate password versions are affected?
Affected versions include releases prior to 1.4.1 across affected packages: generate-password.
What version fixes GHSA-6qqf-vvcr-7qrv?
Upgrading to 1.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is generate-password affected?
Yes, generate-password is affected in releases prior to 1.4.1. Upgrade your dependency to 1.4.1 or later.
What CWE is associated with GHSA-6qqf-vvcr-7qrv?
GHSA-6qqf-vvcr-7qrv 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 GHSA-6qqf-vvcr-7qrv?
Run the dependency tree command: 'npm ls generate-password'. 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-6qqf-vvcr-7qrv",
  "modified" : "2020-08-31T18:34:48Z",
  "published" : "2019-05-23T09:27:22Z",
  "aliases" : [ ],
  "summary" : "Cryptographically Weak PRNG in generate-password",
  "details" : "Affected versions of generate-password generate random values that are biased towards certain characters depending on the chosen character sets. This may result in guessable passwords.\n\n\n## Recommendation\n\nUpdate to version 1.4.1 or later.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "generate-password"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/brendanashworth/generate-password/pull/26"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/762"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-338" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-05-23T07:38:39Z",
    "nvd_published_at" : null
  }
}