Vulnerabilities in pkg:npm/xmlhttprequest-ssl

PACKAGE
Advisory Identifier: GHSA-h4j5-c7cj-74xg
Advisory Summary

CVE-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.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/xmlhttprequest-ssl

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/xmlhttprequest-ssl. 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
GHSA-72mh-269x-7mh5 CVE-2021-31597 CRITICAL Improper Certificate Validation in xmlhttprequest-ssl

CVE-2020-28502 at a Glance

CVE Identifier CVE-2020-28502
GHSA Identifier GHSA-h4j5-c7cj-74xg
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Xmlhttprequest
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

xmlhttprequest fixed: 1.7.0
npm install xmlhttprequest@1.7.0
xmlhttprequest-ssl fixed: 1.6.2
npm install xmlhttprequest-ssl@1.6.2
Verify Direct and Transitive Dependencies

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

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.

CVE-2020-28502 Affected Xmlhttprequest Versions

2 component(s)
Fixed Versions:
1.7.01.6.2
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?
CVE-2020-28502 is a security vulnerability in Xmlhttprequest involving xmlhttprequest and xmlhttprequest-ssl vulnerable to Arbitrary Code Injection under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Xmlhttprequest versions are affected?
Affected versions include releases prior to 1.7.0, 1.6.2 across affected packages: xmlhttprequest, xmlhttprequest-ssl.
What version fixes CVE-2020-28502?
Upgrading to 1.7.0, 1.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xmlhttprequest affected?
Yes, xmlhttprequest is affected in releases prior to 1.7.0. Upgrade your dependency to 1.7.0 or later.
Is xmlhttprequest-ssl affected?
Yes, xmlhttprequest-ssl is affected in releases prior to 1.6.2. Upgrade your dependency to 1.6.2 or later.
What is the CVSS score of CVE-2020-28502?
CVE-2020-28502 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-28502?
CVE-2020-28502 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (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.).
How can I check npm dependencies for CVE-2020-28502?
Run the dependency tree command: 'npm ls xmlhttprequest'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}