Vulnerabilities in pkg:gem/uglifier
PACKAGECVE-2015-8857 is a CRITICAL (CVSS 9.8) incorrect handling of non-boolean comparisons vulnerability (CWE-1254: Incorrect Comparison Logic Granularity) affecting Uglify js libraries in the npm ecosystem. The issue involves incorrect handling of non-boolean comparisons during minification in uglify-js. Remediation is available by upgrading affected packages to version 2.4.24, 2.7.2.
pkg:gem/uglifier
Vulnerability advisories affecting package pkg:gem/uglifier. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-34r7-q49f-h37c | CVE-2015-8857 | CRITICAL | Incorrect Handling of Non-Boolean Comparisons During Minification in uglify-js |
CVE-2015-8857 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-2015-8857
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.4.24
Upgrade uglifier to 2.7.2
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-8857, 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.4.24), 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-1254: Incorrect Comparison Logic Granularity, where the product's comparison logic is performed over a series of steps rather than across the entire string in one operation. if there is a comparison logic failure on one of these steps, the operation may be vulnerable to a timing attack that can result in the interception of the process for nefarious purposes. 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-8857 Affected Uglify js Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
uglify-js
|
npm |
< 2.4.24
|
2.4.24
|
|
uglifier
|
RubyGems |
< 2.7.2
|
2.7.2
|
References
Frequently Asked Questions
What is CVE-2015-8857?
Which Uglify js versions are affected?
What version fixes CVE-2015-8857?
Is uglify-js affected?
Is uglifier affected?
What is the CVSS score of CVE-2015-8857?
What CWE is associated with CVE-2015-8857?
How can I check npm dependencies for CVE-2015-8857?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-34r7-q49f-h37c",
"modified" : "2021-10-29T14:15:03Z",
"published" : "2017-10-24T18:33:36Z",
"aliases" : [ "CVE-2015-8857" ],
"summary" : "Incorrect Handling of Non-Boolean Comparisons During Minification in uglify-js",
"details" : "Versions of `uglify-js` prior to 2.4.24 are affected by a vulnerability which may cause crafted JavaScript to have altered functionality after minification.\n\n## Recommendation\n\nUpgrade UglifyJS to version >= 2.4.24.",
"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" : "uglify-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.4.24"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "uglifier"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.7.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-8857"
}, {
"type" : "WEB",
"url" : "https://github.com/mishoo/UglifyJS2/issues/751"
}, {
"type" : "WEB",
"url" : "https://github.com/lautis/uglifier/commit/4677bfe38142937ff952f95605bcec4618892c3e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mishoo/UglifyJS2"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/uglifier/CVE-2015-8857.yml"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20200227190830/http://www.securityfocus.com/bid/96410"
}, {
"type" : "WEB",
"url" : "https://zyan.scripts.mit.edu/blog/backdooring-js"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2016/04/20/11"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1254", "CWE-670" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T20:54:00Z",
"nvd_published_at" : "2017-01-23T21:59:00Z"
}
}