Skip to content
OpenAdvisories
Critical · 9.1 CVE-2022-35255 EUVD-2022-38146GHSA-p36x-w6hr-88jp

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

Published Dec 5, 2022 · Updated Apr 30, 2025 · Assigned by hackerone

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.

Affected products

VendorProductAffectedFixed
NodeJS Node 4.0 – < 4.*, 5.0 – < 5.*, 6.0 – < 6.*, 7.0 – < 7.*, 8.0 – < 8.*, 9.0 – < 9.*, 10.0 – < 10.*, 11.0 – < 11.*, 12.0 – < 12.*, 13.0 – < 13.*, 15.0 – < 15.*, 17.0 – < 17.*, 18.0 – < 18.9.1 4.*

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 nodejs 18.10.0+dfsg-1 —
Debian 13 nodejs 18.10.0+dfsg-1 —
Debian 12 nodejs 18.10.0+dfsg-1 —
Debian 11 nodejs 12.22.12~dfsg-1~deb11u3 DSA-5326-1
ReleasePackageFixed inAdvisory
RHEL 9 nodejs +3 1:16.17.1-1.el9_0 RHSA-2022:6963
RHEL 9 npm 1:8.15.0-1.16.17.1.1.el9_0 RHSA-2022:6963
RHEL 8 nodejs +3 1:16.17.1-1.module+el8.6.0+16848+a483195a RHSA-2022:7821, RHSA-2022:6964
RHEL 8 nodejs-nodemon 2.0.19-1.module+el8.7.0+16061+0a247725 RHSA-2022:7821, RHSA-2022:6964
RHEL 8 nodejs-packaging 25-1.module+el8.5.0+10992+fac5fe06 RHSA-2022:7821, RHSA-2022:6964
RHEL 8 nodejs-packaging-bundler 2021.06-4.module+el8.7.0+15582+19c314fa RHSA-2022:7821
RHEL 8 npm 1:8.15.0-1.16.17.1.1.module+el8.6.0+16848+a483195a RHSA-2022:7821, RHSA-2022:6964

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 nodejs +3 1:16.17.1-1.el9_0 ALSA-2022:6963
AlmaLinux 9 npm 1:8.15.0-1.16.17.1.1.el9_0 ALSA-2022:6963
AlmaLinux 8 nodejs +3 1:16.17.1-1.module_el8.6.0+3328+2e4711d7 ALSA-2022:7821, ALSA-2022:6964
AlmaLinux 8 nodejs-nodemon 2.0.19-1.module_el8.7.0+3343+ea2b7901 ALSA-2022:7821, ALSA-2022:6964
AlmaLinux 8 nodejs-packaging 25-1.module_el8.5.0+2605+45d748af ALSA-2022:7821, ALSA-2022:6964
AlmaLinux 8 nodejs-packaging-bundler 2021.06-4.module_el8.7.0+3343+ea2b7901 ALSA-2022:7821
AlmaLinux 8 npm 1:8.15.0-1.16.17.1.1.module_el8.6.0+3328+2e4711d7 ALSA-2022:7821, ALSA-2022:6964

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 9 nodejs 1:16.17.1-1.el9_0 RLSA-2022:6963
Rocky Linux 8 nodejs 1:16.17.1-1.module+el8.6.0+1046+80feca58 RLSA-2022:7821, RLSA-2022:6964
Rocky Linux 8 nodejs-nodemon 2.0.19-1.module+el8.7.0+1072+5b168780 RLSA-2022:7821, RLSA-2022:6964
Rocky Linux 8 nodejs-packaging 25-1.module+el8.5.0+702+221f14e6 RLSA-2022:7821, RLSA-2022:6964
ReleasePackageFixed inAdvisory
SLES 15 SP4 nodejs16 16.17.1-150400.3.9.1 SUSE-SU-2022:3656-1
SLES 15 SP4 nodejs18 18.13.0-150400.9.3.1 SUSE-SU-2023:0419-1
SLES 15 SP3 nodejs16 16.17.1-150300.7.12.1 SUSE-SU-2022:3615-1
SLES 12 nodejs16 16.17.1-8.12.1 SUSE-SU-2022:3524-1
SLES 12 nodejs18 18.13.0-8.3.1 SUSE-SU-2023:0408-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed nodejs16 16.17.1-1.1 openSUSE-SU-2024:12370-1
openSUSE Tumbleweed nodejs18 18.10.0-1.1 openSUSE-SU-2024:12376-1
openSUSE Leap 15.5 nodejs18 18.13.0-150400.9.3.1 SUSE-SU-2023:0419-1
openSUSE Leap 15.4 nodejs16 16.17.1-150400.3.9.1 SUSE-SU-2022:3656-1
openSUSE Leap 15.4 nodejs18 18.13.0-150400.9.3.1 SUSE-SU-2023:0419-1
openSUSE Leap 15.3 nodejs16 16.17.1-150300.7.12.1 SUSE-SU-2022:3615-1
ReleasePackageFixed inAdvisory
Alpine v3.24 nodejs 16.17.1-r0 —
Alpine v3.24 nodejs-current 18.9.1-r0 —
Alpine v3.23 nodejs 16.17.1-r0 —
Alpine v3.23 nodejs-current 18.9.1-r0 —
Alpine v3.22 nodejs 16.17.1-r0 —
Alpine v3.22 nodejs-current 18.9.1-r0 —
Alpine v3.21 nodejs 16.17.1-r0 —
Alpine v3.21 nodejs-current 18.9.1-r0 —
Alpine v3.20 nodejs 16.17.1-r0 —
Alpine v3.20 nodejs-current 18.9.1-r0 —
Show 5 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 nodejs 16.17.1-r0 —
Alpine v3.19 nodejs-current 18.9.1-r0 —
Alpine v3.18 nodejs 16.17.1-r0 —
Alpine v3.18 nodejs-current 18.9.1-r0 —
Alpine v3.17 nodejs 16.17.1-r0 —
Alpine v3.17 nodejs-current 18.9.1-r0 —
Alpine v3.16 nodejs 16.17.1-r0 —
Alpine v3.16 nodejs-current 18.9.1-r0 —
Alpine v3.15 nodejs 16.17.1-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 nodejs +4 1:18.12.1-1.amzn2023.0.2 ALAS2023-2023-084
Amazon Linux 2023 npm 1:8.19.2-1.18.12.1.1.amzn2023.0.2 ALAS2023-2023-084
Amazon Linux 2023 v8-devel 2:10.2.154.15-1.18.12.1.1.amzn2023.0.2 ALAS2023-2023-084

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 graalvm22-ce-11 +41 22.3.0-1.el9 ELSA-2022-9955, ELSA-2022-9954, ELSA-2022-9953
Oracle Linux 9 nodejs +3 1:16.17.1-1.el9_0 ELSA-2022-6963
Oracle Linux 9 npm 1:8.15.0-1.16.17.1.1.el9_0 ELSA-2022-6963
Oracle Linux 8 graalvm22-ce-11 +41 22.3.0-1.el8 ELSA-2022-9951, ELSA-2022-9950, ELSA-2022-9949
Oracle Linux 8 nodejs +3 1:16.17.1-1.module+el8.6.0+20846+72f1269d ELSA-2022-7821, ELSA-2022-6964
Oracle Linux 8 nodejs-nodemon 2.0.19-1.module+el8.7.0+20766+0a247725 ELSA-2022-7821, ELSA-2022-6964
Oracle Linux 8 nodejs-packaging 25-1.module+el8.5.0+20388+4b61e68d ELSA-2022-7821, ELSA-2022-6964
Oracle Linux 8 nodejs-packaging-bundler 2021.06-4.module+el8.7.0+20766+0a247725 ELSA-2022-7821
Oracle Linux 8 npm 1:8.15.0-1.16.17.1.1.module+el8.6.0+20846+72f1269d ELSA-2022-7821, ELSA-2022-6964
Oracle Linux 7 graalvm22-ce-11 +41 22.3.0-1.el7 ELSA-2022-9947, ELSA-2022-9946, ELSA-2022-9945

Advisories 38

References