Skip to content
Crypto Disclosed report Advanced CVE-2022-35255

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.

imhunternull Follow

Originally disclosed on HackerOne

Bounty$4,000 High View original
  • 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

The original report as published on HackerOne, by imhunternull. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.