Vulnerabilities in pkg:npm/unzipper

PACKAGE
Advisory Identifier: GHSA-884w-698f-927f
Advisory Summary

CVE-2018-1002203 is a MODERATE (CVSS 5.5) arbitrary file write vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Unzipper libraries in the npm ecosystem. The issue involves arbitrary file write via archive extraction in unzipper. Remediation is available by upgrading affected packages to version 0.8.13.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/unzipper

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/unzipper. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-884w-698f-927f CVE-2018-1002203 MODERATE Arbitrary File Write via Archive Extraction in unzipper

CVE-2018-1002203 at a Glance

CVE Identifier CVE-2018-1002203
GHSA Identifier GHSA-884w-698f-927f
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Unzipper
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N).

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

How to Fix CVE-2018-1002203

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

unzipper fixed: 0.8.13
npm install unzipper@0.8.13
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 unzipper

How to Check if You Are Affected

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

npm ls unzipper

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

Note: The npm ls unzipper 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Unzipper, 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 `unzipper` before 0.8.13 are vulnerable to arbitrary file write when used to extract a specifically crafted archive that contains path traversal filenames (`../../file.txt` for example). ## Recommendation Update to version 0.3.18 or later.

CVE-2018-1002203 Affected Unzipper Versions

1 component(s)
Fixed Versions:
0.8.13
Product / Package Ecosystem Affected Versions Fixed Version
unzipper
npm
< 0.8.13
0.8.13

References

Frequently Asked Questions

What is CVE-2018-1002203?
CVE-2018-1002203 is a security vulnerability in Unzipper involving Arbitrary File Write via Archive Extraction in unzipper under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Unzipper versions are affected?
Affected versions include releases prior to 0.8.13 across affected packages: unzipper.
What version fixes CVE-2018-1002203?
Upgrading to 0.8.13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is unzipper affected?
Yes, unzipper is affected in releases prior to 0.8.13. Upgrade your dependency to 0.8.13 or later.
What is the CVSS score of CVE-2018-1002203?
CVE-2018-1002203 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2018-1002203?
CVE-2018-1002203 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2018-1002203?
Run the dependency tree command: 'npm ls unzipper'. 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-884w-698f-927f",
  "modified" : "2023-09-11T22:41:23Z",
  "published" : "2018-07-27T17:06:50Z",
  "aliases" : [ "CVE-2018-1002203" ],
  "summary" : "Arbitrary File Write via Archive Extraction in unzipper",
  "details" : "Versions of `unzipper` before 0.8.13 are vulnerable to arbitrary file write when used to extract a specifically crafted archive that contains path traversal filenames (`../../file.txt` for example).\n\n\n## Recommendation\n\nUpdate to version 0.3.18 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "unzipper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.13"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-1002203"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ZJONSSON/node-unzipper/pull/59"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ZJONSSON/node-unzipper/commit/2220ddd5b58f6252069a4f99f9475441ad0b50cd"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/362119"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-884w-698f-927f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snyk/zip-slip-vulnerability"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/research/zip-slip-vulnerability"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/npm:unzipper:20180415"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/680"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:24:49Z",
    "nvd_published_at" : null
  }
}