CVE-2018-20835: Improper Input Validation in tar-fs
Summary
CVE-2018-20835: Improper Input Validation in tar-fs. Affects tar-fs versions < 1.16.2. Fixed in 1.16.2. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The tar-fs package is an npm package that provides a simple interface for creating and extracting tar archives. It is commonly used in Node.js applications to work with tar files. The vulnerability identified as CVE-2018-20835 affects versions of tar-fs prior to 1.16.2. This vulnerability allows an attacker to overwrite arbitrary files on the system when extracting a tarball containing a hardlink to an existing file, followed by a plain file with the same name as the hardlink. The content of the plain file replaces the existing file content, leading to potential data loss or unauthorized modifications.
Vulnerability Detail
The vulnerability arises due to improper input validation in the tar-fs package. When extracting a tarball, if a hardlink to an existing file is encountered, followed by a plain file with the same name, the content of the plain file overwrites the existing file content. This can be exploited by an attacker to overwrite critical files on the system, potentially leading to unauthorized access, data loss, or system compromise. The vulnerability has a CVSS score of 7.5, indicating a high severity level.
How To Fix
Minimum fixed version
1.16.2
This is the first release that contains the fix.
npm install tar-fs@1.16.2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is essential to update the tar-fs package to the fixed version to mitigate the risk of exploitation.
Conclusion
The vulnerability in the tar-fs package (CVE-2018-20835) allows an attacker to overwrite arbitrary files on the system, potentially leading to unauthorized access, data loss, or system compromise. To mitigate this risk, it is crucial to update the tar-fs package to version 1.16.2 or later. This update includes a fix for the vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tar-fs →
FAQ
The vulnerability allows an attacker to overwrite arbitrary files on the system, potentially leading to unauthorized access, data loss, or system compromise.
You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and the tool will provide real-time alerts for open-source vulnerabilities, including this one.
Yes, the fix for this vulnerability is available in version 1.16.2 of the tar-fs package. It is recommended to update to this version to mitigate the risk of exploitation.
There are no known workarounds for this vulnerability. Updating to the fixed version of the tar-fs package is the recommended solution.
The CVSS score of this vulnerability is 7.5, indicating a high severity level.
Related vulnerabilities
Recent vulnerabilities recorded for tar-fs.