Path Traversal in konloch/bytecode-viewer
Reported on
Jan 5th 2022
Description
the.bytecode.club:Bytecode-Viewer
is a lightweight user-friendly Java/Android Bytecode Viewer, Decompiler & More.
Affected versions of the package are vulnerable to Arbitrary File Write via Archive Extraction (AKA "Zip Slip").
The vulnerability is exploited using a specially crafted archive that holds directory traversal filenames (e.g. ../../evil.exe). The Zip Slip vulnerability can affect numerous archive formats, including zip, jar, tar, war, cpio, apk, rar and 7z. The attacker can then overwrite executable files and either invoke them remotely or wait for the system or user to call them, thus achieving remote command execution on the victim’s machine.
Proof of Concept
// Zipslip.class
import java.io.IOException;
import the.bytecode.club.bytecodeviewer.util.*;
public class Zipslip {
public static void main(String[] args) {
try {
ZipUtils.unzipFilesToPath("C:\\evil.zip", "D:\\test\\test"); //evil.zip contains ../../evil.exe
} catch (IOException e) {
e.printStackTrace();
}
}
}
Impact
The impact of a Zip Slip vulnerability would allow an attacker to create or overwrite existing files on the filesystem. In the context of a web application, a web shell could be placed within the application directory to achieve code execution.
SECURITY.md
a year ago
Hi, thank you for this report, I will let the collaborators know and we will look into this.
@konloch Thanks for the quick response and fix. Please confirm the fix, to disclose this publicly.
@admin Can I get a CVE for this?
@konloch Are you okay to assign a CVE for this issue? Which will alert the users of your package about this vulnerability. Huntr will assign a CVE if you agrees.
Once we get @maintainer approval, we are more than happy to assign a CVE here.
Hey everyone, I opened a security advisory on Github and they have been able to get a CVE for this issue - CVE-2022-21675
Here is the Github Security Advisory - https://github.com/Konloch/bytecode-viewer/security/advisories/GHSA-3wq9-j4fc-4wmc
Thank you again for this report!
@konlock - great!
For your reference, we can arrange the creation and publishing of a CVE on your behalf in the future, if you prefer.
Great work all! 🎊