CVE-2023-30590
nodejs: DiffieHellman do not generate keys after setting a private key
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · June 20, 2023
Updated · November 21, 2025
Description
A vulnerability has been identified in the Node.js, where a 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.
Statement
The generateKeys() API function returned from crypto.createDiffieHellman() in Node.js does not behave as documented as the documentation states that the function “generates private and public Diffie-Hellman key values.” However, the actual implementation only generates a private key if one has not yet been set, and does not recompute or regenerate the public key if the private key was previously defined using setPrivateKey(), which is why this could only in theory, result in weak or predictable shared secrets. The issue at hand is a developer facing hazard caused by a mismatch in the documentation and application of the function, and is not in itself a security vulnerability, which is why Redhat has assessed this as moderate.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CWE not specified