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.
// 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();
}
}
}
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.