CVE-2021-23443: Edge.js Cross-Site Scripting Vulnerability
MODERATECVE-2021-23443 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')) affecting Edge.js libraries in the npm ecosystem. The issue involves cross-site scripting in edge.js. Remediation is available by upgrading affected packages to version 5.3.2.
CVE-2021-23443 at a Glance
Security Impact
CVSS: 5.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:R/S:U/C:L/I:L/A:N).
How to Fix CVE-2021-23443
To remediate this vulnerability, upgrade all affected Edge.js 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 edge.js@5.3.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls edge.js
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-23443, inspect your project dependencies using npm:
npm ls edge.js
Analyze the terminal output to locate any version of Edge.js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.3.2), your application is affected.
Note: The npm ls edge.js 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-843: Access of Resource Using Incompatible Type ('Type Confusion'), where the product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. In Edge.js, 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-23443 Affected Edge.js Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
edge.js
|
npm |
< 5.3.2
|
5.3.2
|
References
Frequently Asked Questions
What is CVE-2021-23443?
Which Edge.js versions are affected?
What version fixes CVE-2021-23443?
Is edge.js affected?
What is the CVSS score of CVE-2021-23443?
What CWE is associated with CVE-2021-23443?
How can I check npm dependencies for CVE-2021-23443?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-55r9-7mf8-m382",
"modified" : "2023-09-11T16:20:48Z",
"published" : "2021-09-22T20:36:46Z",
"aliases" : [ "CVE-2021-23443" ],
"summary" : "Cross-site Scripting in edge.js",
"details" : "Edge is a logical and batteries included template engine for Node.js. This affects the package edge.js before 5.3.2. A type confusion vulnerability can be used to bypass input sanitization when the input to be rendered is an array (instead of a string or a SafeValue), even if `{{ }}` are used.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "edge.js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.3.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23443"
}, {
"type" : "WEB",
"url" : "https://github.com/edge-js/edge/commit/fa2c7fde86327aeae232752e89a6e37e2e469e21"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/edge-js/edge"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-EDGEJS-1579556"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-843" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-09-22T14:25:18Z",
"nvd_published_at" : "2021-09-21T17:15:00Z"
}
}