CVE-2018-20834 Arbitrary File Overwrite in tar

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 node-tar 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-20834?

CVE-2018-20834 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 node-tar before version 4.4.2 (excluding version 2.2.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. A patch has been applied to node-tar v2.2.2).

Weakness: CWE-59

Which versions are affected by CVE-2018-20834?

4 open source packages ship an affected version, including tar. It affects 1 product.

PackageAffectedFixed in
tar npmAll versions2.2.2
tar npmAll versions2.2.2
tar npmFrom 3.0.04.4.2
tar npmFrom 3.0.04.4.2

Products include Isaacs Tar.

How do I fix CVE-2018-20834?

Upgrade tar to a fixed version for your release line: 2.2.2 or 4.4.2.

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

Is CVE-2018-20834 being exploited?

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

Sources

Also known as DEBIAN-CVE-2018-20834, GHSA-j44m-qm6p-hp7m.

Is CVE-2018-20834 in your software?

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

Check your SBOMs for free