Skip to main content

CVE-2022-36045: CWE-330: Use of Insufficiently Random Values in NodeBB NodeBB

Medium
Published: Wed Aug 31 2022 (08/31/2022, 15:10:09 UTC)
Source: CVE
Vendor/Project: NodeBB
Product: NodeBB

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.

AI-Powered Analysis

AILast updated: 06/22/2025, 23:21:06 UTC

Technical Analysis

CVE-2022-36045 is a vulnerability in NodeBB, a popular open-source forum software built on Node.js that supports Redis, MongoDB, or PostgreSQL databases and uses web sockets for real-time interactions. The vulnerability stems from the use of an insecure pseudo-random number generator (PRNG) in the helper function `utils.generateUUID`, which relied on JavaScript's `Math.random()`. This function is used extensively across NodeBB versions dating back to at least v1.0.1. Because `Math.random()` is not cryptographically secure, an attacker can predict the output of the password reset token generation process. By repeatedly invoking the password reset functionality and analyzing the reset codes, an attacker can calculate valid reset tokens for arbitrary accounts without needing access to the victim's email or any other authentication factors. This enables account takeover without victim interaction. The vulnerability affects all NodeBB installations running versions prior to 1.19.8 and version 2.0.0. It has been patched in NodeBB versions 1.19.x (from 1.19.8 onward) and 2.x. No known workarounds exist, so immediate patching is required to mitigate the risk. There are no known exploits in the wild at this time, but the vulnerability's nature makes it a critical risk for any exposed NodeBB forum, especially those with sensitive user data or administrative accounts. The weakness is classified under CWE-330 (Use of Insufficiently Random Values) and CWE-338 (Use of Cryptographically Weak PRNG).

Potential Impact

The primary impact of this vulnerability is unauthorized account takeover, which compromises confidentiality and integrity of user accounts on affected NodeBB forums. Attackers can reset passwords without victim involvement, potentially gaining access to sensitive personal information, private discussions, or administrative controls. This can lead to data breaches, defacement, or further lateral attacks within organizations using NodeBB for internal or external communications. For European organizations, this raises compliance risks under GDPR due to unauthorized access to personal data. The availability impact is limited but possible if attackers disrupt forum operations or lock out legitimate users. Because NodeBB is used by a range of communities and enterprises, the scope includes both public-facing and internal forums. The ease of exploitation is moderate; it requires scripting and repeated password reset requests but no privileged access or victim interaction. The vulnerability affects all installations running vulnerable versions, which may be widespread given NodeBB's popularity in Europe. The lack of known exploits suggests the threat is currently theoretical but patching is urgent to prevent future attacks.

Mitigation Recommendations

Immediately upgrade NodeBB installations to version 1.19.8 or later, or to any patched 2.x version to fully remediate the vulnerability. If immediate upgrade is not feasible, apply the specific security patch or cherry-pick the changeset addressing the insecure PRNG usage from the NodeBB repository. Restrict access to the password reset functionality by implementing rate limiting and CAPTCHA challenges to reduce the feasibility of automated token prediction attacks. Monitor password reset logs for unusual activity patterns such as repeated reset requests from the same IP or targeting multiple accounts. Review and harden email delivery systems to ensure password reset emails are not intercepted or redirected. For organizations using NodeBB internally, consider additional multi-factor authentication (MFA) on user accounts to mitigate the impact of compromised passwords. Conduct a security audit of all NodeBB instances to identify and upgrade vulnerable versions promptly. Educate users about the importance of strong, unique passwords and vigilance for suspicious account activity.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-07-15T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9844c4522896dcbf3bdc

Added to database: 5/21/2025, 9:09:24 AM

Last enriched: 6/22/2025, 11:21:06 PM

Last updated: 8/18/2025, 12:32:51 AM

Views: 16

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats