description: A weak randomness in WebCrypto keygen vulnerability exists in Node.js 18 due to a change with EntropySource() in SecretKeyGenTraits::DoKeyGen() in src/crypto/crypto_keygen.cc. There are two problems with this: 1) It does not check the return value, it assumes EntropySource() always succeeds, but it can (and sometimes will) fail. 2) The random data returned byEntropySource() may not be cryptographically strong and therefore not suitable as keying material.
problem types: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) (CWE-338)
affected:
{
vendor: n/a
product: https://github.com/nodejs/node
versions:
version: Fixed in 16.17.1+,18.9.1+, status: affected
}