CVE-2021-43787: Nodebb Cross-Site Scripting Vulnerability
CRITICALCVE-2021-43787 is a CRITICAL (CVSS 9.0) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Nodebb libraries in the npm ecosystem. The issue involves xss via prototype pollution in nodebb. Remediation is available by upgrading affected packages to version 1.18.5.
CVE-2021-43787 at a Glance
Security Impact
CVSS: 9.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H).
How to Fix CVE-2021-43787
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-43787, 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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-43787 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-43787?
Which Nodebb versions are affected?
What version fixes CVE-2021-43787?
Is nodebb affected?
What is the CVSS score of CVE-2021-43787?
What CWE is associated with CVE-2021-43787?
How can I check npm dependencies for CVE-2021-43787?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wx69-rvg3-x7fc",
"modified" : "2021-12-01T15:07:01Z",
"published" : "2021-11-30T22:21:01Z",
"aliases" : [ "CVE-2021-43787" ],
"summary" : "XSS via prototype pollution in NodeBB ",
"details" : "### Impact\nA prototype pollution vulnerability in the uploader module allowed a malicious user to inject arbitrary data (i.e. javascript) into the DOM, theoretically allowing for an account takeover when used in conjunction with a path traversal vulnerability disclosed at the same time as this report.\n\n### Patches\nThe vulnerability has been patched as of v1.18.5.\n\n### Workarounds\nCherry-pick commit hash 1783f918bc19568f421473824461ff2ed7755e4c 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:L/UI:R/S:C/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-wx69-rvg3-x7fc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43787"
}, {
"type" : "WEB",
"url" : "https://github.com/NodeBB/NodeBB/commit/1783f918bc19568f421473824461ff2ed7755e4c"
}, {
"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-79" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-11-30T14:35:09Z",
"nvd_published_at" : "2021-11-29T20:15:00Z"
}
}