CVE Vulnerabilities

CVE-2022-35255

Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)

Published: Dec 05, 2022 | Modified: Apr 24, 2025
CVSS 3.x
9.1
CRITICAL
Source:
NVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
CVSS 2.x
RedHat/V2
RedHat/V3
8.2 IMPORTANT
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

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.

Weakness

The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG’s algorithm is not cryptographically strong.

Affected Software

NameVendorStart VersionEnd Version
Node.jsNodejs15.0.0 (including)15.14.0 (including)
Node.jsNodejs16.0.0 (including)16.12.0 (including)
Node.jsNodejs16.13.0 (including)16.17.1 (excluding)
Node.jsNodejs18.0.0 (including)18.9.1 (excluding)
Red Hat Enterprise Linux 8RedHatnodejs:16-8060020221007164523.ad008a3a*
Red Hat Enterprise Linux 8RedHatnodejs:18-8070020221004121421.bd1311ed*
Red Hat Enterprise Linux 9RedHatnodejs-1:16.17.1-1.el9_0*
NodejsUbuntubionic*
NodejsUbuntukinetic*
NodejsUbuntutrusty*
NodejsUbuntuupstream*
NodejsUbuntuxenial*

Extended Description

When a non-cryptographic PRNG is used in a cryptographic context, it can expose the cryptography to certain types of attacks. Often a pseudo-random number generator (PRNG) is not designed for cryptography. Sometimes a mediocre source of randomness is sufficient or preferable for algorithms that use random numbers. Weak generators generally take less processing power and/or do not use the precious, finite, entropy sources on a system. While such PRNGs might have very useful features, these same features could be used to break the cryptography.

Potential Mitigations

References