CVE-2022-35255: Weak RNG
A vulnerability was found in NodeJS due to weak randomness in the WebCrypto keygen within the SecretKeyGenTraits::DoKeyGen() in src/crypto/cryptokeygen.cc. Node.js made calls to EntropySource() in SecretKeyGenTraits::DoKeyGen(). However, it does not check the return value and assumes the EntropySource() always succeeds, but it can and sometimes will fail. This flaw allows a remote attacker to decrypt sensitive information.
Other sources
A weak randomness in WebCrypto keygen vulnerability exists in Node.js 18 due to a change with EntropySource() in SecretKeyGenTraits::DoKeyGen() in src/crypto/cryptokeygen.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.
Node.js could provide weaker than expected security, caused by the failure to check the return value after calls are made to EntropySource() in SecretKeyGenTraits::DoKeyGen() in src/crypto/cryptokeygen.cc. A remote attacker could exploit this vulnerability to launch further attacks on the system.
— IBM
Node.js made calls to EntropySource() in SecretKeyGenTraits::DoKeyGen() in src/crypto/cryptokeygen.cc. However, it does not check the return value, it assumes EntropySource() always succeeds, but it can (and sometimes will) fail.
Impacts: All versions of the 18.x and 16.x release lines.
https://nodejs.org/en/blog/vulnerability/september-2022-security-releases/
— Red Hat
Affected Software
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is CVE-2022-35255?
CVE-2022-35255 is a vulnerability found in NodeJS due to weak randomness in the WebCrypto keygen within the SecretKeyGenTraits::DoKeyGen() function.
How severe is CVE-2022-35255?
CVE-2022-35255 has a severity value of 9.1, which is considered critical.
Which versions of NodeJS are affected by CVE-2022-35255?
NodeJS versions up to and including 16.17.1 and 18.9.1 are affected by CVE-2022-35255.
How can I fix CVE-2022-35255?
To fix CVE-2022-35255, update your NodeJS installation to version 16.17.1 or higher for NodeJS 16, and version 18.9.1 or higher for NodeJS 18.
Where can I find more information about CVE-2022-35255?
You can find more information about CVE-2022-35255 at the following references: [NodeJS September 2022 Security Releases](https://nodejs.org/en/blog/vulnerability/september-2022-security-releases/), [Red Hat Bugzilla - CVE-2022-35255](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=2130524), [Red Hat Bugzilla - CVE-2022-35255](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=2130523).