Vulnerabilities in pkg:gem/uglifier

PACKAGE
Advisory Identifier: GHSA-34r7-q49f-h37c
Advisory Summary

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

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/uglifier

1 Known Advisory Record(s)

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

CVE Identifier CVE-2015-8857
GHSA Identifier GHSA-34r7-q49f-h37c
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-1254: Incorrect Comparison Logic Granularity
Affected Product Uglify js
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-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.

uglify-js fixed: 2.4.24
npm install uglify-js@2.4.24
uglifier fixed: 2.7.2
Upgrade uglifier to 2.7.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 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

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. ## Recommendation Upgrade UglifyJS to version >= 2.4.24.

CVE-2015-8857 Affected Uglify js Versions

2 component(s)
Fixed Versions:
2.4.242.7.2
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?
CVE-2015-8857 is a security vulnerability in Uglify js involving Incorrect Handling of Non-Boolean Comparisons During Minification in uglify-js under CWE-1254: Incorrect Comparison Logic Granularity.
Which Uglify js versions are affected?
Affected versions include releases prior to 2.4.24, 2.7.2 across affected packages: uglify-js, uglifier.
What version fixes CVE-2015-8857?
Upgrading to 2.4.24, 2.7.2 (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.4.24. Upgrade your dependency to 2.4.24 or later.
Is uglifier affected?
Yes, uglifier is affected in releases prior to 2.7.2. Upgrade your dependency to 2.7.2 or later.
What is the CVSS score of CVE-2015-8857?
CVE-2015-8857 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-2015-8857?
CVE-2015-8857 is classified under CWE-1254: Incorrect Comparison Logic Granularity (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.).
How can I check npm dependencies for CVE-2015-8857?
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-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"
  }
}