CVE-2022-35255: 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.
Critical CVSS 9.1
- CVE id
- CVE-2022-35255
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| Node.js Runtimes and servers |
>= 15.0.0, <= 15.14.0 >= 16.0.0, <= 16.12.0 >= 16.13.0, < 16.17.1 >= 18.0.0, < 18.9.1 |
16.17.1, 18.9.1 |
How to fix it
Upgrade Node.js to the fixed release of the line you run: 16.17.1, 18.9.1.
node --version
- Install the patched Node.js release of your major line (nvm install, or the node image tag) everywhere the app runs and builds.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
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.
References
- CVE-2022-35255 on the NVD
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2022-35255
- Web: https://cert-portal.siemens.com/productcert/pdf/ssa-332410.pdf
- Web: https://hackerone.com/reports/1690000
- Web: https://security.netapp.com/advisory/ntap-20230113-0002/
- Web: https://www.debian.org/security/2023/dsa-5326
- Web: https://cert-portal.siemens.com/productcert/pdf/ssa-332410.pdf
- Web: https://hackerone.com/reports/1690000
- Web: https://security.netapp.com/advisory/ntap-20230113-0002/
- Web: https://www.debian.org/security/2023/dsa-5326
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.