CVE-2018-20835: Improper Input Validation in tar-fs

tar-fs Updated 02 Oct 2025

Summary

01/05/2019
Yes i
High
7.5

CVE-2018-20835: Improper Input Validation in tar-fs. Affects tar-fs versions < 1.16.2. Fixed in 1.16.2. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback