Vulnerabilities in pkg:npm/xmlhttprequest
PACKAGECVE-2020-28502 is a CRITICAL (CVSS 9.8) xmlhttprequest and xmlhttprequest-ssl vulnerable to vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Xmlhttprequest libraries in the npm ecosystem. The issue involves xmlhttprequest and xmlhttprequest-ssl vulnerable to arbitrary code injection. Remediation is available by upgrading affected packages to version 1.7.0, 1.6.2.
pkg:npm/xmlhttprequest
Vulnerability advisories affecting package pkg:npm/xmlhttprequest. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-h4j5-c7cj-74xg | CVE-2020-28502 | CRITICAL | xmlhttprequest and xmlhttprequest-ssl vulnerable to Arbitrary Code Injection |
CVE-2020-28502 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-2020-28502
To remediate this vulnerability, upgrade all affected Xmlhttprequest 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 xmlhttprequest@1.7.0
npm install xmlhttprequest-ssl@1.6.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls xmlhttprequest
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-28502, inspect your project dependencies using npm:
npm ls xmlhttprequest
Analyze the terminal output to locate any version of Xmlhttprequest in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.0), your application is affected.
Note: The npm ls xmlhttprequest 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Xmlhttprequest, 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-2020-28502 Affected Xmlhttprequest Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
xmlhttprequest
|
npm |
< 1.7.0
|
1.7.0
|
|
xmlhttprequest-ssl
|
npm |
< 1.6.2
|
1.6.2
|
References
Frequently Asked Questions
What is CVE-2020-28502?
Which Xmlhttprequest versions are affected?
What version fixes CVE-2020-28502?
Is xmlhttprequest affected?
Is xmlhttprequest-ssl affected?
What is the CVSS score of CVE-2020-28502?
What CWE is associated with CVE-2020-28502?
How can I check npm dependencies for CVE-2020-28502?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h4j5-c7cj-74xg",
"modified" : "2023-09-08T19:46:08Z",
"published" : "2021-05-04T18:02:34Z",
"aliases" : [ "CVE-2020-28502" ],
"summary" : "xmlhttprequest and xmlhttprequest-ssl vulnerable to Arbitrary Code Injection",
"details" : "This affects the package xmlhttprequest before 1.7.0; all versions of package xmlhttprequest-ssl. Provided requests are sent synchronously (`async=False` on `xhr.open`), malicious user input flowing into `xhr.send` could result in arbitrary code being injected and run.",
"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" : "xmlhttprequest"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.7.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "xmlhttprequest-ssl"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.6.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-28502"
}, {
"type" : "WEB",
"url" : "https://github.com/driverdan/node-XMLHttpRequest/commit/983cfc244c7567ad6a59e366e55a8037e0497fe6"
}, {
"type" : "WEB",
"url" : "https://github.com/mjwwit/node-XMLHttpRequest/commit/ee1e81fc67729c7c0eba5537ed7fe1e30a6b3291"
}, {
"type" : "WEB",
"url" : "https://github.com/driverdan/node-XMLHttpRequest/blob/1.6.0/lib/XMLHttpRequest.js#L480"
}, {
"type" : "WEB",
"url" : "https://github.com/driverdan/node-XMLHttpRequest/blob/1.6.0/lib/XMLHttpRequest.js%23L480"
}, {
"type" : "WEB",
"url" : "https://github.com/mjwwit/node-XMLHttpRequest/blob/ae38832a0f1347c5e96dda665402509a3458e302/lib/XMLHttpRequest.js#L531"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1082937"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1082938"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-XMLHTTPREQUEST-1082935"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-XMLHTTPREQUESTSSL-1082936"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-03-18T20:34:02Z",
"nvd_published_at" : "2021-03-05T18:15:00Z"
}
}