CVE-2020-8131 Path Traversal in Yarn

High 7.5 Published Updated

Attackers can write to arbitrary filesystem paths via malicious packages, potentially leading to code execution in Yarn.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2020-8131?

CVE-2020-8131 is a high-severity path traversal vulnerability in yarn, published on 24 Feb 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Arbitrary filesystem write vulnerability in Yarn before 1.22.0 allows attackers to write to any path on the filesystem and potentially lead to arbitrary code execution by forcing the user to install a malicious package.

Weakness: CWE-22

Which versions are affected by CVE-2020-8131?

2 open source packages ship an affected version, including yarn. It affects 1 product.

PackageAffectedFixed in
yarn npmAll versions1.22.0
yarn npmAll versions1.22.0

Products include Yarnpkg Yarn.

How do I fix CVE-2020-8131?

Upgrade yarn to 1.22.0 or later.

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

Is CVE-2020-8131 being exploited?

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

Sources

Also known as DEBIAN-CVE-2020-8131, GHSA-8mfc-v7wv-p62g, ROOT-APP-NPM-CVE-2020-8131.

Is CVE-2020-8131 in your software?

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

Check your SBOMs for free