Vulnerabilities in pkg:npm/otp-generator
PACKAGECVE-2021-23451 is a CRITICAL (CVSS 9.8) otp-generator before v3.0.0 insecurely generates vulnerability (CWE-330: Use of Insufficiently Random Values) affecting Otp generator libraries in the npm ecosystem. The issue involves otp-generator before v3.0.0 insecurely generates random one-time passwords. Remediation is available by upgrading affected packages to version 3.0.0.
pkg:npm/otp-generator
Vulnerability advisories affecting package pkg:npm/otp-generator. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-6x93-h9g3-9phr | CVE-2021-23451 | CRITICAL | otp-generator before v3.0.0 insecurely generates random one-time passwords |
CVE-2021-23451 at a Glance
Security Impact
CVSS: 9.8
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:H/I:H/A:H).
How to Fix CVE-2021-23451
To remediate this vulnerability, upgrade all affected Otp generator dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install otp-generator@3.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls otp-generator
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-23451, inspect your project dependencies using npm:
npm ls otp-generator
Analyze the terminal output to locate any version of Otp generator 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 otp-generator 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-330: Use of Insufficiently Random Values, where the product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers. In Otp generator, 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
CVE-2021-23451 Affected Otp generator Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
otp-generator
|
npm |
< 3.0.0
|
3.0.0
|
References
Frequently Asked Questions
What is CVE-2021-23451?
Which Otp generator versions are affected?
What version fixes CVE-2021-23451?
Is otp-generator affected?
What is the CVSS score of CVE-2021-23451?
What CWE is associated with CVE-2021-23451?
How can I check npm dependencies for CVE-2021-23451?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6x93-h9g3-9phr",
"modified" : "2022-08-06T09:35:03Z",
"published" : "2022-07-26T00:01:05Z",
"aliases" : [ "CVE-2021-23451" ],
"summary" : "otp-generator before v3.0.0 insecurely generates random one-time passwords",
"details" : "The package otp-generator before 3.0.0 are vulnerable to Insecure Randomness due to insecure generation of random one-time passwords, which may allow a brute-force attack.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "otp-generator"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23451"
}, {
"type" : "WEB",
"url" : "https://github.com/Maheshkumar-Kakade/otp-generator/issues/12"
}, {
"type" : "WEB",
"url" : "https://github.com/Maheshkumar-Kakade/otp-generator/commit/b27de1ce439ae7f533cec26677e9698671275b70"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Maheshkumar-Kakade/otp-generator"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JS-OTPGENERATOR-1655480"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-330" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-08-06T09:35:03Z",
"nvd_published_at" : "2022-07-25T14:15:00Z"
}
}