CVE-2022-35255CWE-338

A weak randomness in WebCrypto keygen vulnerability exists in Node.js 18 due to a change with EntropySource() in SecretKeyGenTraits::DoKeyGen() in…

Critical · published December 5, 2022

CVSS v3.1
9.1
EPSS
2%
Percentile
81.5
In the wild
Unconfirmed
What it is

🔥 A critical vulnerability lurks in Node.js 18's WebCrypto key generation — it’s like trusting a dice roll without checking if the dice are loaded! ⚡ Think of it as a bakery that always uses the same recipe but forgets to check if the ingredients are fresh. When random data for cryptographic keys comes from a source that might not deliver the goods, it’s like using stale flour in your cakes — not safe for anyone! An attacker could potentially exploit this flaw to generate weak encryption keys, allowing them to bypass security measures. This means sensitive data could be exposed, putting user information and system security at risk. Trusting compromised keys is absolutely devastating!

Put simply

Think of it as a bakery that always uses the same recipe but forgets to check if the ingredients are fresh. When random data for cryptographic keys comes from a source that might not deliver the goods, it’s like using stale flour in your cakes — not safe for anyone! This vulnerability arises from the EntropySource() function in Node.js, which fails to validate the strength of random data generated for keying material. If EntropySource() cannot produce strong randomness, it compromises the cryptographic integrity of the keys generated.

What to do

An attacker could potentially exploit this flaw to generate weak encryption keys, allowing them to bypass security measures. This means sensitive data could be exposed, putting user information and system security at risk. Trusting compromised keys is absolutely devastating! Update Node.js to the latest patched version immediately to mitigate this issue. Ensure that the key generation process checks the return value of EntropySource() to confirm successful and strong randomness. Regularly audit cryptographic implementations in your application. You've got this! Follow these steps, and you'll restore the integrity of your security. 🛡️

The record
Technical detail
CVSS v3.1
9.1 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
CVSS v4.0
Not supplied
EPSS
0.02091 · 81.5th percentile
Weakness
CWE-338 · Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
Published
2022-12-05T00:00Z
EPSS history
Timeline
  • 05 DEC 00:00Z
    A weak randomness in WebCrypto keygen vulnerability exists in Node.js 18 due to a change with EntropySource() in SecretKeyGenTraits::DoKeyGen() in…
    cvelistv5