exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

py7zr 0.20.0 Directory Traversal

py7zr 0.20.0 Directory Traversal
Posted Dec 7, 2022
Authored by Matteo Cosentino

A directory traversal vulnerability in the SevenZipFile.extractall() function of the python library py7zr versions 0.20.0 and earlier allows attackers to read arbitrary files on the local machine via a malicious 7z file extraction.

tags | exploit, arbitrary, local, python, file inclusion
advisories | CVE-2022-44900
SHA-256 | 7aa7ca72652dab91234127d8332a19316f0f61be17e1c626e65aae18d9435347

py7zr 0.20.0 Directory Traversal

Change Mirror Download
CVE-2022-44900: path traversal vulnerability in py7zr

Directory traversal vulnerability in SevenZipFile.extractall() function of
the python library py7zr version 0.20.0 and earlier allow attackers to read
arbitrary files on the local machine via malicious 7z file extraction.

CVE-2022-44900 <https://www.cve.org/CVERecord?id=CVE-2022-44900>
vulnerability allows attackers to achieve arbitrary file read and arbitrary
file write. To do so, an attacker needs to create a malicious 7z archive
containing a symlink to achieve an arbitrary file read and a file with a
path traversal payload as name to achieve an arbitrary file write.
Exploiting

The script used for tests is the following:

import py7zr
import click

@click.command()
@click.argument("filename")

def main_procedure(filename):
with py7zr.SevenZipFile(filename, 'r') as archive:
archive.extractall()

main_procedure()

The vulnerabile function targeted is py7zr.SevenZipFile.extractall().

A lab setup has been built to test for vulnerabilities. Directories
structured as follow were used:

├── start_point
│ ├── archive.7z
│ └── py7zr_test.py
└── target
├── write
└── read

The start_point directory contains the script used for tests and the
malicious archive containing the path traversal payload in the form of the
filename of an archived file.

To achieve an arbitrary file read, one of the files in the archives needs
to have ../target/write set as name. The content of the file will be
written into target/write.

In a similar way, to achieve an arbitrary file read, a symlink pointing to
../target/read needs to be present in the archive. When extracted the
symlink will consist of the content of target/read.
Disclosure timeline

29/10/2022 - Maintainer was notified privately of the vulnerabilities
30/10/2022 - Response from maintainer
01/11/2022 - Release of patched version 0.20.1
01/11/2022 - CVE ID request
06/12/2022 - CVE ID obtained
06/12/2022 - Public disclosure
------------------------------
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close