Executive brief
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.
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
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