The generateKeys() API function returned from crypto...
High severity
Unreviewed
Published
Nov 28, 2023
to the GitHub Advisory Database
•
Updated Mar 27, 2024
Description
Published by the National Vulnerability Database
Nov 28, 2023
Published to the GitHub Advisory Database
Nov 28, 2023
Last updated
Mar 27, 2024
The 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.
References