CVE-2018-1002204: cthackers adm-zip path traversal in archive extraction

CVE-2018-1002204 · Severity: low · CVSS 3.1 · Published 2018-07-27

adm-zip is a popular JavaScript library used to create and extract compressed ZIP archives. A vulnerability known as 'Zip Slip' allows an attacker to create a malicious ZIP file that, when extracted, writes files to locations outside of the intended folder. This could allow an attacker to overwrite critical system files or configuration data, potentially leading to system instability or unauthorized code execution.

Technologies: adm-zip (npm). Vendors: npm.

Quick answers

Is CVE-2018-1002204 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2018-1002204 being exploited in the wild.
How severe is CVE-2018-1002204?
Low severity, with a CVSS score of 3.1, published 27 July 2018.
Which products and versions are affected?
adm-zip (npm) SEMVER:introduced=0,fixed=0.4.11.
Is there a fix for CVE-2018-1002204?
Yes. adm-zip (npm): upgrade to 0.4.11 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2018-1002204 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2018-1002204?
Check whether you run adm-zip (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • adm-zip (npm): upgrade to 0.4.11 or later
    npm install adm-zip@0.4.11

Technical details

The adm-zip library fails to properly validate file paths within a ZIP archive during the extraction process. By including 'dot-dot-slash' (../) sequences in the filenames within a specially crafted archive, an attacker can trigger a path traversal vulnerability (CWE-22). When the library's extraction functions (such as extractAllTo) concatenate the malicious entry name with the target directory, the resulting path resolves outside the intended destination. This allows for arbitrary file writes on the local filesystem. The issue is fixed in version 0.4.9 by ensuring the resolved absolute path of the extracted file starts with the absolute path of the target directory.

Affected products

  • cthackers adm-zip < 0.4.9

Identifiers

  • CVE-2018-1002204
  • GHSA-3v6h-hqm4-2rg6

Timeline

  • 2018-04-22: patched: Pull request with fix submitted to cthackers/adm-zip
  • 2018-07-25: advisory: NVD published CVE-2018-1002204
  • 2018-07-27: disclosed: GitHub Advisory published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.