CVE-2020-36560 Path traversal in github.com/artdarek/go-unzip

Critical 9.1 Published Updated

Attackers can write or overwrite files outside the target directory via malicious archives in the go-unzip 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-2020-36560?

CVE-2020-36560 is a critical path traversal vulnerability in github.com/artdarek/go-unzip, published on 27 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Due to improper path sanitization, archives containing relative file paths can cause files to be written (or overwritten) outside of the target directory.

Weakness: CWE-22

Which versions are affected by CVE-2020-36560?

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

PackageAffectedFixed in
github.com/artdarek/go-unzip GoAll versions1.0.0
github.com/artdarek/go-unzip GoAll versions2.0.0
github.com/artdarek/go-unzip GoAll versions2.0.0

Products include Go-Unzip Project Go-Unzip.

How do I fix CVE-2020-36560?

Upgrade github.com/artdarek/go-unzip to a fixed version for your release line: 1.0.0 or 2.0.0.

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

Is CVE-2020-36560 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2020-36560 exists.

Sources

Also known as GHSA-rmj9-q58g-9qgg, GO-2020-0034.

Is CVE-2020-36560 in your software?

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

Check your SBOMs for free