CVE-2022-46164: Nodebb NodeBB Vulnerable To Account Takeover Vulnerability

CRITICAL
Advisory Identifier: GHSA-rf3g-v8p5-p675
CVSS 9.4
CWE-665
Published
Advisory Summary

CVE-2022-46164 is a CRITICAL (CVSS 9.4) nodebb vulnerable to account takeover vulnerability (CWE-665: Improper Initialization) affecting Nodebb libraries in the npm ecosystem. The issue involves nodebb vulnerable to account takeover via prototype vulnerability. Remediation is available by upgrading affected packages to version 2.6.1.

CVE-2022-46164 at a Glance

CVE Identifier CVE-2022-46164
GHSA Identifier GHSA-rf3g-v8p5-p675
Severity CRITICAL
CVSS v3.1 Base Score 9.4
CWE Classification CWE-665: Improper Initialization
Affected Product Nodebb
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2022-46164

To remediate this vulnerability, upgrade all affected Nodebb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nodebb fixed: 2.6.1
npm install nodebb@2.6.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls nodebb

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-46164, inspect your project dependencies using npm:

npm ls nodebb

Analyze the terminal output to locate any version of Nodebb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.1), your application is affected.

Note: The npm ls nodebb command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-665: Improper Initialization, where the product does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used. In Nodebb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Due to a plain object with a prototype being used in socket.io message handling a specially crafted payload can be used to impersonate other users and takeover accounts. ### Patches Patched in 2.6.1 ### Workarounds Site maintainers can cherry-pick https://github.com/NodeBB/NodeBB/commit/48d143921753914da45926cca6370a92ed0c46b8 into their codebase to patch the exploit. ### For more information If you have any questions or comments about this advisory: Discuss it on [our community forum](https://github.com/NodeBB/NodeBB/security/advisories/community.nodebb.org/) Email us at [support@nodebb.org](mailto:support@nodebb.org)

CVE-2022-46164 Affected Nodebb Versions

1 component(s)
Fixed Versions:
2.6.1
Product / Package Ecosystem Affected Versions Fixed Version
nodebb
npm
< 2.6.1
2.6.1

References

Frequently Asked Questions

What is CVE-2022-46164?
CVE-2022-46164 is a security vulnerability in Nodebb involving NodeBB vulnerable to account takeover via prototype vulnerability under CWE-665: Improper Initialization.
Which Nodebb versions are affected?
Affected versions include releases prior to 2.6.1 across affected packages: nodebb.
What version fixes CVE-2022-46164?
Upgrading to 2.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nodebb affected?
Yes, nodebb is affected in releases prior to 2.6.1. Upgrade your dependency to 2.6.1 or later.
What is the CVSS score of CVE-2022-46164?
CVE-2022-46164 has a CVSS v3.1 base score of 9.4 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2022-46164?
CVE-2022-46164 is classified under CWE-665: Improper Initialization (The product does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used.).
How can I check npm dependencies for CVE-2022-46164?
Run the dependency tree command: 'npm ls nodebb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rf3g-v8p5-p675",
  "modified" : "2022-12-05T23:06:14Z",
  "published" : "2022-12-05T23:06:14Z",
  "aliases" : [ "CVE-2022-46164" ],
  "summary" : "NodeBB vulnerable to account takeover via prototype vulnerability",
  "details" : "### Impact\nDue to a plain object with a prototype being used in socket.io message handling a specially crafted payload can be used to impersonate other users and takeover accounts.\n\n### Patches\nPatched in 2.6.1\n\n### Workarounds\nSite maintainers can cherry-pick https://github.com/NodeBB/NodeBB/commit/48d143921753914da45926cca6370a92ed0c46b8 into their codebase to patch the exploit.\n\n### For more information\nIf you have any questions or comments about this advisory:\n\nDiscuss it on [our community forum](https://github.com/NodeBB/NodeBB/security/advisories/community.nodebb.org/)\nEmail us at [support@nodebb.org](mailto:support@nodebb.org)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nodebb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.6.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/NodeBB/NodeBB/security/advisories/GHSA-rf3g-v8p5-p675"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-46164"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NodeBB/NodeBB/commit/48d143921753914da45926cca6370a92ed0c46b8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/NodeBB/NodeBB"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NodeBB/NodeBB/releases/tag/v2.6.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-665" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-05T23:06:14Z",
    "nvd_published_at" : "2022-12-05T21:15:00Z"
  }
}