Lucene search

K
huntrReady-research5C6D8DCF-6BE1-4314-ACE6-A40D6EFD393B
HistoryJan 05, 2022 - 1:28 p.m.

Path Traversal in konloch/bytecode-viewer

2022-01-0513:28:08
ready-research
www.huntr.dev
6

0.004 Low

EPSS

Percentile

73.5%

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.

0.004 Low

EPSS

Percentile

73.5%

Related for 5C6D8DCF-6BE1-4314-ACE6-A40D6EFD393B