Skip to content
Heist/ feed
Back to feed
Critical

Account takeover via cryptographically weak PRNG in NodeBB Forum

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-36045
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 05:41 UTC · Revision 1

Source evidence

Account takeover via cryptographically weak PRNG in NodeBB Forum

core-osv · Original source

Published 31 Aug 2022, 15:10 UTC

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.

osv:CVE-2022-36045
Complete source record
{
  "id": "da34f1ea38d77dd24d06914e26e65e0176ddc2485bcd843262e8a32a1541b7a1",
  "url": "https://osv.dev/vulnerability/CVE-2022-36045",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Account takeover via cryptographically weak PRNG in NodeBB Forum",
    "summary": "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.",
    "evidence": "osv:CVE-2022-36045",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2022-36045",
      "aliases": [
        "CVE-2022-36045",
        "GHSA-p4cc-w597-6cpm"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/nodebb/nodebb",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "fdf8cf5842f17d4ad2d3141199bdf3ac964b6689"
                },
                {
                  "introduced": "6e011b8ff5f23bd62c69fc916d486b983f07499c"
                },
                {
                  "fixed": "81e3c1ba488d03371a5ce8d0ebb5c5803026e0f9"
                },
                {
                  "fixed": "e802fab87f94a13f397f04cfe6068f2f7ddf7888"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:nodebb:nodebb:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.19.8"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:nodebb:nodebb:2.0.0:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.0.0"
                      },
                      {
                        "last_affected": "2.0.0"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "range": [
                      {
                        "fixed": "81e3c1ba488d03371a5ce8d0ebb5c5803026e0f9"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "e802fab87f94a13f397f04cfe6068f2f7ddf7888"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.0.0",
            "= 2.0.0",
            "v1.19.7",
            "v1.19.6",
            "v1.19.4",
            "v1.19.3",
            "v1.19.2",
            "v1.19.1",
            "v1.19.0",
            "v1.17.0-beta.5",
            "v1.17.0-beta.4",
            "v1.17.0-beta.3",
            "v1.17.0-beta.2",
            "v1.17.0-beta.0",
            "v1.16.1-beta.0",
            "v1.15.3-beta.0",
            "v1.15.2-beta.1",
            "v1.15.2-beta.0",
            "v1.15.1",
            "v1.15.1-beta.0",
            "v1.15.0",
            "v1.15.0-rc.5",
            "v1.15.0-rc.4",
            "v1.15.0-rc.3",
            "v1.15.0-rc.1",
            "v1.15.0-rc.0",
            "v1.15.0-beta.30",
            "v1.15.0-beta.29",
            "v1.15.0-beta.27",
            "v1.15.0-beta.25",
            "v1.15.0-beta.24",
            "v1.15.0-beta.23",
            "v1.15.0-beta.22",
            "v1.15.0-beta.21",
            "v1.15.0-beta.19",
            "v1.15.0-beta.18",
            "v1.15.0-beta.17",
            "v1.15.0-beta.16",
            "v1.15.0-beta.15",
            "v1.15.0-beta.14",
            "v1.15.0-beta.13",
            "v1.15.0-beta.12",
            "v1.15.0-beta.11",
            "v1.15.0-beta.10",
            "v1.15.0-beta.9",
            "v1.15.0-beta.8",
            "v1.15.0-beta.7",
            "v1.15.0-beta.6",
            "v1.15.0-beta.5",
            "v1.15.0-beta.4",
            "v1.15.0-beta.3",
            "v1.15.0-beta.2",
            "v1.15.0-beta.1",
            "v1.15.0-beta.0",
            "v1.14.3-beta.16",
            "v1.14.3-beta.15",
            "v1.14.3-beta.14",
            "v1.14.3-beta.13",
            "v1.14.3-beta.12",
            "v1.14.3-beta.11",
            "v1.14.3-beta.10",
            "v1.14.3-beta.9",
            "v1.14.3-beta.8",
            "v1.14.3-beta.7",
            "v1.14.3-beta.6",
            "v1.14.3-beta.5",
            "v1.14.3-beta.4",
            "v1.14.3-beta.0",
            "v1.14.2-beta.1",
            "v1.14.1-beta.3",
            "v1.14.1-beta.1",
            "v1.14.1-beta.0",
            "v1.5.3",
            "v0.9.2",
            "v0.5.0-2",
            "v0.5.0-1",
            "v0.3.2",
            "v0.3.1",
            "v0.3.0",
            "v0.2.0",
            "v0.0.6",
            "v0.0.3"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-36045.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:42.905978445Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/36xxx/CVE-2022-36045.json",
        "https://github.com/NodeBB/NodeBB/security/advisories/GHSA-p4cc-w597-6cpm",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-36045",
        "https://github.com/NodeBB/NodeBB/commit/81e3c1ba488d03371a5ce8d0ebb5c5803026e0f9",
        "https://github.com/NodeBB/NodeBB/commit/e802fab87f94a13f397f04cfe6068f2f7ddf7888"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-330",
          "CWE-338"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/36xxx/CVE-2022-36045.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-36045",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 510782,
  "published_at": "2022-08-31T15:10:09+00:00"
}