Use of Cryptographically Weak Pseudo-Random Number Generator in WebCrypto keygen
Node.js 18's WebCrypto key generation used an entropy source whose return value was not checked and whose output might not be cryptographically strong, so keys could be weaker than intended.
Originally disclosed on HackerOne
- Triaged in 13 hours
- Fixed in 10 days
- Paid in 10 days
- Disclosed after 40 days
Summary by the program
CVE-2022-35255 Detail
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.
NVD Link: https://nvd.nist.gov/vuln/detail/CVE-2022-35255 HackerOne original report: https://hackerone.com/reports/1690000
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the key-generation code assumed the entropy source always succeeded and always produced cryptographically strong output, without verifying either condition.
Impact
Keys generated through WebCrypto in Node.js 18 could be weaker than intended because the random data may not be cryptographically strong.
What the attacker needed
Node.js 18 with WebCrypto keygen
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When software creates a secret key, it needs unpredictable random numbers. This report says Node.js 18's key-generation code used a random source that could fail silently or produce numbers that are not truly unpredictable, so the resulting keys might be weaker than expected.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.