CyberSecBulletin
CVE-2022-35255NVD status: Modified

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

CVE-2022-35255 is a critical-severity use of cryptographically weak pseudo-random number generator (PRNG) vulnerability in Node from Node.js, with a CVSS 3.1 base score of 9.1 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists versions 4.*, 5.*, 6.* as the first without the flaw, so updating Node to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 2.13% chance of exploitation within 30 days, higher than 82% of scored CVEs.

Patch this week

Critical severity: a successful attack would have severe impact.

What to do

  1. Update Node to 4.* or 5.* or 6.* or 7.*, whichever matches your release line, or a later version.
  2. Update Node.js to 16.17.1 or 18.9.1, whichever matches your release line, or a later version.
  3. Update Sinec Ins to 1.0 or a later version.
  4. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
Node.jsNode4.0 up to, but not including, 4.*; 5.0 up to, but not including, 5.*; 6.0 up to, but not including, 6.*; 7.0 up to, but not including, 7.*; 8.0 up to, but not including, 8.*; 9.0 up to, but not including, 9.*; 10.0 up to, but not including, 10.*; 11.0 up to, but not including, 11.*; and 5 more ranges4.*, 5.*, 6.*, 7.*, 8.*, 9.*
Node.jsNode.js15.0.0 through 15.14.0; 16.0.0 through 16.12.0; 16.13.0 up to, but not including, 16.17.1; 18.0.0 up to, but not including, 18.9.116.17.1, 18.9.1
SiemensSinec Insbefore 1.0; 1.01.0
DebianDebian Linux11.0Not stated

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
NoneAvailability is not affected.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.19.1CriticalNVD
CVSS 3.19.1CriticalCISA (ADP)

Official 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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)

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

How developers prevent this class of flaw

  • Use functions or hardware which use a hardware-based random number generation for all crypto. This is the recommended solution. Use CyptGenRandom on Windows, or hw_rand() on Linux.

More Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) vulnerabilities (CWE-338)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Technical write-ups (may include proof of concept)

Other vulnerabilities in Node

All Node vulnerabilities

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

Spotted an error? Tell us.