NodeBB: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
CVE-2022-36045 is a critical-severity use of cryptographically weak pseudo-random number generator (PRNG) vulnerability in NodeBB, with a CVSS 3.1 base score of 9.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected NodeBB versions: < 1.19.8; = 2.0.0. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 1.35% chance of exploitation within 30 days, higher than 72% of scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Check which version of NodeBB you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 9.0 | Critical | CNA (github.com) |
| CVSS 3.1 | 9.8 | Critical | NVD |
Official description
NodeBB Forum Software is powered by Node.js and supports either Redis, MongoDB, or a PostgreSQL database. It utilizes web sockets for instant interactions and real-time notifications. `utils.generateUUID`, a helper function available in essentially all versions of NodeBB (as far back as v1.0.1 and potentially earlier) used a cryptographically insecure Pseudo-random number generator (`Math.random()`), which meant that a specially crafted script combined with multiple invocations of the password reset functionality could enable an attacker to correctly calculate the reset code for an account they do not have access to. This vulnerability impacts all installations of NodeBB. The vulnerability allows for an attacker to take over any account without the involvement of the victim, and as such, the remediation should be applied immediately (either via NodeBB upgrade or cherry-pick of the specific changeset. The vulnerability has been patched in version 2.x and 1.19.x. There is no known workaround, but the patch sets listed above will fully patch the vulnerability.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG's algorithm is not cryptographically strong.
How developers prevent this class of flaw
- Use functions or hardware which use a hardware-based random number generation for all crypto. This is the recommended solution. Use CyptGenRandom on Windows, or hw_rand() on Linux.
More Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) vulnerabilities (CWE-338)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- github.com/NodeBB/NodeBB/security/advisories/GHSA-p4cc-w597-6cpmThird Party Advisory
Patches and release notes
- github.com/NodeBB/NodeBB/commit/81e3c1ba488d03371a5ce8d0ebb5c5803026e0f9Third Party Advisory
- github.com/NodeBB/NodeBB/commit/e802fab87f94a13f397f04cfe6068f2f7ddf7888Third Party Advisory
Other vulnerabilities in NodeBB
- 7.5 High severity
- 8.6 High severity
- 7.5 High severity
- 9.8 Critical severity
- 9.8 Critical severity
- 9.8 Critical severity
Recent Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) vulnerabilities
- 7.4 High severity
- 7.5 High severity
- 7.5 High severity
Spotted an error? Tell us.