CVE-2020-5259: Dojox Prototype Pollution Vulnerability

LOW
Advisory Identifier: GHSA-3hw5-q855-g6cw
CVSS 7.7
CWE-94
Published
Advisory Summary

CVE-2020-5259 is a LOW (CVSS 7.7) prototype pollution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Dojox libraries in the npm ecosystem. The issue involves prototype pollution in dojox. Remediation is available by upgrading affected packages to version 1.11.10, 1.12.8, 1.13.7, 1.14.6, 1.15.3, 1.16.2.

CVE-2020-5259 at a Glance

CVE Identifier CVE-2020-5259
GHSA Identifier GHSA-3hw5-q855-g6cw
Severity LOW
CVSS v3.1 Base Score 7.7
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Dojox
Package Ecosystem npm
Published Date
Last Updated

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:H/PR:L/UI:R/S:C/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2020-5259

To remediate this vulnerability, upgrade all affected Dojox dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

dojox fixed: 1.11.10
npm install dojox@1.11.10
dojox fixed: 1.12.8
npm install dojox@1.12.8
dojox fixed: 1.13.7
npm install dojox@1.13.7
dojox fixed: 1.14.6
npm install dojox@1.14.6
dojox fixed: 1.15.3
npm install dojox@1.15.3
dojox fixed: 1.16.2
npm install dojox@1.16.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 dojox

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2020-5259, inspect your project dependencies using npm:

npm ls dojox

Analyze the terminal output to locate any version of Dojox in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.11.10), your application is affected.

Note: The npm ls dojox 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 Dojox, 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

The Dojox jQuery wrapper `jqMix` mixin method is vulnerable to Prototype Pollution. Affected Area: ``` //https://github.com/dojo/dojox/blob/master/jq.js#L442 var tobj = {}; for(var x in props){ // the "tobj" condition avoid copying properties in "props" // inherited from Object.prototype. For example, if obj has a custom // toString() method, don't overwrite it with the toString() method // that props inherited from Object.prototype if((tobj[x] === undefined || tobj[x] != props[x]) && props[x] !== undefined && obj != props[x]){ if(dojo.isObject(obj[x]) && dojo.isObject(props[x])){ if(dojo.isArray(props[x])){ obj[x] = props[x]; }else{ obj[x] = jqMix(obj[x], props[x]); } }else{ obj[x] = props[x]; } ```

CVE-2020-5259 Affected Dojox Versions

6 component(s)
Fixed Versions:
1.11.101.12.81.13.71.14.61.15.31.16.2
Product / Package Ecosystem Affected Versions Fixed Version
dojox
npm
< 1.11.10
1.11.10
dojox
npm
≥ 1.12.0
< 1.12.8
1.12.8
dojox
npm
≥ 1.13.0
< 1.13.7
1.13.7
dojox
npm
≥ 1.14.0
< 1.14.6
1.14.6
dojox
npm
≥ 1.15.0
< 1.15.3
1.15.3
dojox
npm
≥ 1.16.0
< 1.16.2
1.16.2

References

Frequently Asked Questions

What is CVE-2020-5259?
CVE-2020-5259 is a security vulnerability in Dojox involving Prototype Pollution in Dojox under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Dojox versions are affected?
Affected versions include releases prior to 1.11.10, 1.12.8, 1.13.7, 1.14.6, 1.15.3, 1.16.2 across affected packages: dojox.
What version fixes CVE-2020-5259?
Upgrading to 1.11.10, 1.12.8, 1.13.7, 1.14.6, 1.15.3, 1.16.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is dojox affected?
Yes, dojox is affected in releases prior to 1.11.10, 1.12.8, 1.13.7, 1.14.6, 1.15.3, 1.16.2. Upgrade your dependency to 1.11.10, 1.12.8, 1.13.7, 1.14.6, 1.15.3, 1.16.2 or later.
What is the CVSS score of CVE-2020-5259?
CVE-2020-5259 has a CVSS v3.1 base score of 7.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2020-5259?
CVE-2020-5259 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-5259?
Run the dependency tree command: 'npm ls dojox'. 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-3hw5-q855-g6cw",
  "modified" : "2021-02-18T19:45:35Z",
  "published" : "2020-03-10T18:03:32Z",
  "aliases" : [ "CVE-2020-5259" ],
  "summary" : "Prototype Pollution in Dojox",
  "details" : "The Dojox jQuery wrapper `jqMix` mixin method is vulnerable to Prototype Pollution. \n\nAffected Area:\n```\n//https://github.com/dojo/dojox/blob/master/jq.js#L442\n\t\tvar tobj = {};\n\t\tfor(var x in props){\n\t\t\t// the \"tobj\" condition avoid copying properties in \"props\"\n\t\t\t// inherited from Object.prototype.  For example, if obj has a custom\n\t\t\t// toString() method, don't overwrite it with the toString() method\n\t\t\t// that props inherited from Object.prototype\n\t\t\tif((tobj[x] === undefined || tobj[x] != props[x]) && props[x] !== undefined && obj != props[x]){\n\t\t\t\tif(dojo.isObject(obj[x]) && dojo.isObject(props[x])){\n\t\t\t\t\tif(dojo.isArray(props[x])){\n\t\t\t\t\t\tobj[x] = props[x];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tobj[x] = jqMix(obj[x], props[x]);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tobj[x] = props[x];\n\t\t\t\t}\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "dojox"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.11.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "dojox"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.12.0"
      }, {
        "fixed" : "1.12.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "dojox"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.13.0"
      }, {
        "fixed" : "1.13.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "dojox"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.14.0"
      }, {
        "fixed" : "1.14.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "dojox"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.15.0"
      }, {
        "fixed" : "1.15.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "dojox"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.16.0"
      }, {
        "fixed" : "1.16.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dojo/dojox/security/advisories/GHSA-3hw5-q855-g6cw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5259"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dojo/dojox/commit/47d1b302b5b23d94e875b77b9b9a8c4f5622c9da"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/03/msg00012.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-03-10T18:02:07Z",
    "nvd_published_at" : null
  }
}