CVE-2021-21297: @node red/runtime Prototype Pollution Vulnerability
HIGHCVE-2021-21297 is a HIGH (CVSS 7.7) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @node red/runtime libraries in the npm ecosystem. The issue involves prototype pollution in node-red. Remediation is available by upgrading affected packages to version 1.2.8.
CVE-2021-21297 at a Glance
Security Impact
CVSS: 7.7
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:N/S:C/C:N/I:H/A:N).
How to Fix CVE-2021-21297
To remediate this vulnerability, upgrade all affected @node red/runtime 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 @node-red/runtime@1.2.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @node-red/runtime
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-21297, inspect your project dependencies using npm:
npm ls @node-red/runtime
Analyze the terminal output to locate any version of @node red/runtime in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.8), your application is affected.
Note: The npm ls @node-red/runtime 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-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In @node red/runtime, 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-21297 Affected @node red/runtime Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@node-red/runtime
|
npm |
< 1.2.8
|
1.2.8
|
References
Frequently Asked Questions
What is CVE-2021-21297?
Which @node red/runtime versions are affected?
What version fixes CVE-2021-21297?
Is @node-red/runtime affected?
What is the CVSS score of CVE-2021-21297?
What CWE is associated with CVE-2021-21297?
How can I check npm dependencies for CVE-2021-21297?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xp9c-82x8-7f67",
"modified" : "2021-09-22T13:55:00Z",
"published" : "2021-02-26T16:31:05Z",
"aliases" : [ "CVE-2021-21297" ],
"summary" : "Prototype Pollution in Node-Red",
"details" : "### Impact\n\nNode-RED 1.2.7 and earlier contains a Prototype Pollution vulnerability in the admin API. A badly formed request can modify the prototype of the default JavaScript Object with the potential to affect the default behaviour of the Node-RED runtime.\n\n### Patches\n\nThe vulnerability is patched in the 1.2.8 release.\n\n### Workarounds\n\nA workaround is to ensure only authorised users are able to access the editor url.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [team@nodered.org](mailto:team@nodered.org)\n\n### Acknowledgements\n\nThanks to the Tencent Woodpecker Security Team for disclosing this vulnerability.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@node-red/runtime"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/node-red/node-red/security/advisories/GHSA-xp9c-82x8-7f67"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21297"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/node-red/node-red"
}, {
"type" : "WEB",
"url" : "https://github.com/node-red/node-red/releases/tag/1.2.8"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/@node-red/editor-api"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/@node-red/runtime"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321", "CWE-915" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-02-26T16:22:38Z",
"nvd_published_at" : "2021-02-26T17:15:00Z"
}
}