CVE-2015-8858: Uglify js Denial of Service Vulnerability
HIGHCVE-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
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).
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.
npm install uglify-js@2.6.0
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
CVE-2015-8858 Affected Uglify js Versions
1 component(s)| 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?
Which Uglify js versions are affected?
What version fixes CVE-2015-8858?
Is uglify-js affected?
What is the CVSS score of CVE-2015-8858?
What CWE is associated with CVE-2015-8858?
How can I check npm dependencies for CVE-2015-8858?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}