CVE-2020-36560 Path traversal in github.com/artdarek/go-unzip
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.
| Package | Affected | Fixed in |
|---|---|---|
github.com/artdarek/go-unzip Go | All versions | 1.0.0 |
github.com/artdarek/go-unzip Go | All versions | 2.0.0 |
github.com/artdarek/go-unzip Go | All versions | 2.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.