CVE-2015-8860: Node.js tar arbitrary file write via symlink attack

CVE-2015-8860 · Severity: high · CVSS 7.5 · Published 2017-01-23

The 'tar' library for Node.js, which is used to create and extract compressed archive files, contains a vulnerability in how it handles symbolic links. An attacker can provide a specially crafted archive that, when extracted, allows them to write files to unintended locations on the host system. This could lead to the overwriting of sensitive configuration files or the placement of malicious scripts, potentially compromising the entire server.

Technologies: Nodejs Node.Js, tar (npm). Vendors: Nodejs, npm.

Quick answers

Is CVE-2015-8860 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2015-8860 being exploited in the wild.
How severe is CVE-2015-8860?
High severity, with a CVSS score of 7.5, published 23 January 2017.
Which products and versions are affected?
tar (npm) SEMVER:introduced=0,fixed=2.0.0.
Is there a fix for CVE-2015-8860?
Yes. tar (npm): upgrade to 2.0.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2015-8860 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2015-8860?
Check whether you run Nodejs Node.Js or tar (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

  • tar (npm): upgrade to 2.0.0 or later
    npm install tar@2.0.0

Technical details

The Node.js 'tar' package prior to version 2.0.0 fails to properly validate symbolic links within archives during the extraction process (CWE-59). By including a symlink that points to a location outside the intended extraction directory, a remote attacker can trick the application into writing subsequent files in the archive to arbitrary locations on the filesystem. This is a classic path traversal variant where the link resolution is mishandled. The vulnerability can be exploited if an application accepts and extracts untrusted tarballs. A fix is available in version 2.0.0 and later.

Affected products

  • Node.js tar < 2.0.0

Identifiers

  • CVE-2015-8860
  • GHSA-gfjr-3jmm-4g9v

Timeline

  • 2015-12-01: disclosed: Vulnerability identified (approximate based on CVE ID)
  • 2016-04-20: advisory: Public disclosure via Openwall mailing list
  • 2017-01-23: disclosed: NVD publication date

References

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