CVE-2021-43786: Nodebb API Token Verification Can Be Vulnerability
CRITICALCVE-2021-43786 is a CRITICAL (CVSS 9.8) api token verification can be vulnerability (CWE-287: Improper Authentication) affecting Nodebb libraries in the npm ecosystem. The issue involves api token verification can be bypassed in nodebb. Remediation is available by upgrading affected packages to version 1.18.5.
CVE-2021-43786 at a Glance
Security Impact
CVSS: 9.8
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:H).
How to Fix CVE-2021-43786
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.
npm install nodebb@1.18.5
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-2021-43786, 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 1.18.5), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. 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
CVE-2021-43786 Affected Nodebb Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nodebb
|
npm |
≥ 1.15.0
< 1.18.5
|
1.18.5
|
References
Frequently Asked Questions
What is CVE-2021-43786?
Which Nodebb versions are affected?
What version fixes CVE-2021-43786?
Is nodebb affected?
What is the CVSS score of CVE-2021-43786?
What CWE is associated with CVE-2021-43786?
How can I check npm dependencies for CVE-2021-43786?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hf2m-j98r-4fqw",
"modified" : "2021-12-01T15:06:58Z",
"published" : "2021-11-30T22:21:05Z",
"aliases" : [ "CVE-2021-43786" ],
"summary" : "API token verification can be bypassed in NodeBB ",
"details" : "### Impact\nIncorrect logic present in the token verification step unintentionally allowed master token access to the API.\n\n### Patches\nThe vulnerability has been patch as of v1.18.5.\n\n### Workarounds\nCherry-pick commit hash 04dab1d550cdebf4c1567bca9a51f8b9ca48a500 to receive this patch in lieu of a full upgrade.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [security@nodebb.org](mailto:security@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:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "nodebb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.15.0"
}, {
"fixed" : "1.18.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/NodeBB/NodeBB/security/advisories/GHSA-hf2m-j98r-4fqw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43786"
}, {
"type" : "WEB",
"url" : "https://github.com/NodeBB/NodeBB/commit/04dab1d550cdebf4c1567bca9a51f8b9ca48a500"
}, {
"type" : "WEB",
"url" : "https://blog.sonarsource.com/nodebb-remote-code-execution-with-one-shot"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/NodeBB/NodeBB"
}, {
"type" : "WEB",
"url" : "https://github.com/NodeBB/NodeBB/releases/tag/v1.18.5"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-11-30T14:35:05Z",
"nvd_published_at" : "2021-11-29T20:15:00Z"
}
}