CVE-2020-29529 Unsafe tar unpacking in HashiCorp go-slug

High 7.5 Published Updated

Attackers can bypass directory traversal protections in go-slug using multiple symlinks to read or modify files outside the intended directory.

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

What is CVE-2020-29529?

CVE-2020-29529 is a high-severity path traversal vulnerability in n/a, published on 3 Dec 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

HashiCorp go-slug up to 0.4.3 did not fully protect against directory traversal while unpacking tar archives, and protections could be bypassed with specific constructions of multiple symlinks. Fixed in 0.5.0.

Weakness: CWE-59, CWE-22

Which versions are affected by CVE-2020-29529?

3 open source packages ship an affected version, including github.com/hashicorp/go-slug. It affects 1 product.

PackageAffectedFixed in
github.com/hashicorp/go-slug GoAll versions0.5.0
github.com/hashicorp/go-slug GoAll versions0.5.0
github.com/hashicorp/go-slug GoAll versions0.5.0

Products include Hashicorp Go-Slug.

How do I fix CVE-2020-29529?

Upgrade github.com/hashicorp/go-slug to 0.5.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-29529 being exploited?

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

Sources

Also known as DEBIAN-CVE-2020-29529, GHSA-2g5j-5x95-r6hr, GO-2021-0094.

Is CVE-2020-29529 in your software?

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

Check your SBOMs for free