CVE-2018-20835: Improper Input Validation in tar-fs
7.5
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.51945%
CWE
Published
5/1/2019
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
tar-fs | npm | < 1.16.2 | 1.16.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The key vulnerability stemmed from improper path resolution when handling hardlinks during extraction. The commit 0667282 shows the fix changed from path.resolve(cwd, header.linkname)
to path.join(cwd, path.join('/', header.linkname))
, which prevents path traversal by normalizing the link target path relative to the extraction directory. This function was directly responsible for validating()
hardlink targets, and its lack of proper input validation allowed overwriting arbitrary existing files through specially crafted tarballs.