CVE-2020-36561 Path traversal in github.com/yi-ge/unzip
Attackers can write or overwrite files outside the target directory via crafted archives, affecting applications using this Go 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-36561?
CVE-2020-36561 is a critical path traversal vulnerability in github.com/yi-ge/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-36561?
3 open source packages ship an affected version, including github.com/yi-ge/unzip. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/yi-ge/unzip Go | All versions | 1.0.3-0.20200308084313-2adbaa4891b9 |
github.com/yi-ge/unzip Go | All versions | 1.0.3-0.20200308084313-2adbaa4891b9 |
github.com/yi-ge/unzip Go | All versions | 1.0.3-0.20200308084313-2adbaa4891b9 |
Products include Unzip Project Unzip.
How do I fix CVE-2020-36561?
Upgrade github.com/yi-ge/unzip to 1.0.3-0.20200308084313-2adbaa4891b9 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2020-36561 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2020-36561 exists.
Other vulnerabilities in github.com/yi-ge/unzip
Sources
Also known as GHSA-f5c5-hmw9-v8hx, GO-2020-0035.