CVE-2023-30590
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedThe generateKeys() API function returned from crypto.createDiffieHellman() only generates missing (or outdated) keys, that is, it only generates a private key if none has been set yet, but the function is also needed to compute the corresponding public key after calling setPrivateKey(). However, the documentation says this API call: "Generates private and public Diffie-Hellman key values". The documented behavior is very different from the actual behavior, and this difference could easily lead to security issues in applications that use these APIs as the DiffieHellman may be used as the basis for application-level security, implications are consequently broad.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceIn Node.js crypto.createDiffieHellman(), the generateKeys() function only generates a private key if none exists, failing to compute the corresponding public key when setPrivateKey() has been called. This contradicts the documentation stating it 'Generates private and public Diffie-Hellman key values', potentially causing applications to use incomplete or insecure key pairs for cryptographic operations.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data>= 16.0.0, < 16.20.1>= 18.0.0, < 18.16.1>= 20.0.0, < 20.3.1CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Determine your Node.js versionRun 'node --version' in your terminal to get the installed Node.js version numberAffected if The version is 16.0.0 to 16.20.0, 18.0.0 to 18.16.0, or 20.0.0 to 20.3.0 (any version in the ranges >= 16.0.0 < 16.20.1, >= 18.0.0 < 18.16.1, or >= 20.0.0 < 20.3.1)
-
Identify use of crypto.createDiffieHellmanSearch your codebase for 'crypto.createDiffieHellman' or 'require("crypto").createDiffieHellman' to see if your application creates Diffie-Hellman objectsAffected if Your application uses crypto.createDiffieHellman() to create DH key pairs
-
Check for setPrivateKey() followed by generateKeys()Search for code that calls setPrivateKey() on a DH object and then calls generateKeys() on the same objectAffected if Your code calls setPrivateKey() before calling generateKeys() on the same Diffie-Hellman object
-
Verify public key computation after setPrivateKeyInspect whether your code manually calls getPublicKey() after setPrivateKey() and generateKeys(), or review if getPublicKey() returns a valid computed value rather than incomplete or stale dataAffected if After calling setPrivateKey() then generateKeys(), getPublicKey() returns an incomplete key or the code does not explicitly compute the public key using getPublicKey()
You are affected if your Node.js version is in the vulnerable range AND your application uses the pattern of calling setPrivateKey() followed by generateKeys() on a Diffie-Hellman object without manually computing the public key afterward.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped16.20.118.16.120.3.1
Applications using setPrivateKey() followed by generateKeys() should manually compute the public key using the private key, or audit code to ensure DH key pairs are complete before use in security-critical operations.
Node.js 16.20.1+ (LTS), 18.16.1+ (LTS), or 20.3.1+ (Current)
- Identify the current Node.js version in use by running `node --version`
- Stop any services or applications running on the affected Node.js version
- Upgrade Node.js to version 16.20.1 or higher (for 16.x branches), 18.16.1 or higher (for 18.x branches), or 20.3.1 or higher (for 20.x branches)
- Verify the new Node.js version is installed correctly by running `node --version`
- Restart any affected services or applications to ensure they use the updated Node.js runtime
- Test that crypto.createDiffieHellman() with generateKeys() now correctly generates both private and public keys as documented
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation6.0 h
- Implementation12.0 h
- Testing10.0 h
- Review / QA8.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $10,080.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2023-30590 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2023-30590 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data