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

High 7.5 Published Updated

An attacker can overwrite arbitrary files on the system by crafting a malicious tarball with specific hardlink structures, affecting applications using the tar-fs library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2018-20835?

CVE-2018-20835 is a high-severity path traversal vulnerability in n/a, published on 30 Apr 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

A vulnerability was found in tar-fs before 1.16.2. An Arbitrary File Overwrite issue exists when extracting a tarball containing a hardlink to a file that already exists on the system, in conjunction with a later plain file with the same name as the hardlink. This plain file content replaces the existing file content.

Weakness: CWE-20

Which versions are affected by CVE-2018-20835?

2 open source packages ship an affected version, including tar-fs. It affects 1 product.

PackageAffectedFixed in
tar-fs npmAll versions1.16.2
tar-fs npmAll versions1.16.2

Products include Tar-Fs Project Tar-Fs.

How do I fix CVE-2018-20835?

Upgrade tar-fs to 1.16.2 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2018-20835 being exploited?

There is no known exploitation of CVE-2018-20835 in the wild and no public exploit code.

Sources

Also known as GHSA-x2mc-8fgj-3wmr.

Is CVE-2018-20835 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free