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.
Critical severity: a successful attack would have severe impact.
What to do
- Update Node to 4.* or 5.* or 6.* or 7.*, whichever matches your release line, or a later version.
- Update Node.js to 16.17.1 or 18.9.1, whichever matches your release line, or a later version.
- Update Sinec Ins to 1.0 or a later version.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Node.js | Node | 4.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 ranges | 4.*, 5.*, 6.*, 7.*, 8.*, 9.* |
| Node.js | Node.js | 15.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.1 | 16.17.1, 18.9.1 |
| Siemens | Sinec Ins | before 1.0; 1.0 | 1.0 |
| Debian | Debian Linux | 11.0 | Not 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 system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 9.1 | Critical | NVD |
| CVSS 3.1 | 9.1 | Critical | CISA (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
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Third-party and government advisories
- cert-portal.siemens.com/productcert/pdf/ssa-332410.pdfThird Party Advisory
- security.netapp.com/advisory/ntap-20230113-0002/Third Party Advisory
- debian.org/security/2023/dsa-5326Third Party Advisory
Technical write-ups (may include proof of concept)
- hackerone.com/reports/1690000Exploit, Issue Tracking, Third Party Advisory
Other vulnerabilities in Node
- 7.5 High severity
- 7.5 High severity
- 8.1 High severity
- 7.5 High severity
- 7.5 High severity
- 8.1 High severity
Recent Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) vulnerabilities
- 9.8 Critical severity
- 7.5 High severity
- 9.8 Critical severity
- 7.4 High severity
- 7.5 High severity
- 7.5 High severity
Spotted an error? Tell us.