what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

SE-2008-06.txt

SE-2008-06.txt
Posted Dec 4, 2008
Authored by Stefan Esser | Site sektioneins.de

PHP versions 5.2.6 and below suffer from a directory traversal vulnerability in ZipArchive::extractTo().

tags | exploit, php
SHA-256 | eef814d8f1daf79eb48fd58c0722cd5768082f124ee55a347e0683274424e5eb

SE-2008-06.txt

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


SektionEins GmbH
www.sektioneins.de

-= Security Advisory =-


Advisory: PHP ZipArchive::extractTo() Directory Traversal Vulnerability
Release Date: 2008/12/04
Last Modified: 2008/12/04
Author: Stefan Esser [stefan.esser[at]sektioneins.de]

Application: PHP 5 <= 5.2.6
Severity: PHP applications using ZipArchive::extractTo() to unpack zip
archive files can be tricked to overwrite arbitrary files
writable by the webserver which might result in PHP remote
code execution
Risk: Medium
Vendor Status: Vendor has released PHP 5.2.7 which contains an updated
ZipArchive::extractTo() method that flattens the filename
stored inside zip archives before unpacking
Reference: http://www.sektioneins.de/advisories/SE-2008-06.txt


Overview:

Quote from http://www.php.net
"PHP is a widely-used general-purpose scripting language that
is especially suited for Web development and can be embedded
into HTML."

PHP comes with the zip extension that provides the ZipArchive
class for zip archive manipulation. During an audit of a large
scale PHP applications that uses ZipArchive::extractTo() to
unpack user uploaded zip archives to temporary directories it
was discovered that ZipArchive::extractTo() does not flatten
the filenames stored inside the zip archives.

Therefore it is possible to create zip archives containing
relative filenames that when unpacked will create or overwrite
files outside of the temporary directory.

In the applications like the one in question this results in
a remote PHP code execution vulnerability, because we are
able to drop new PHP files in writable directories within
the webserver's document root directory.


Details:

No details required. To exploit this an attacker just needs to
create a zip archive containing filenames like

../../../../../../../../../../../var/www/wr_dir/evil.php

An easy way to achieve that is to just store a file with a long
name inside the zip archive and then change it with a hex editor


Proof of Concept:

SektionEins GmbH is not going to release a proof of concept
exploit for this vulnerability.


Disclosure Timeline:

23. June 2008 - Notified security@php.net
04. December 2008 - PHP developers released PHP 5.2.7
04. December 2008 - Public Disclosure


Recommendation:

It is recommended to upgrade to the latest version of PHP
which also fixes additional vulnerabilities reported by
third parties.

Grab your copy at:
http://www.php.net/get/php-5.2.7.tar.bz2/from/a/mirror


CVE Information:

The Common Vulnerabilities and Exposures project (cve.mitre.org) has
not assigned a name to this vulnerability yet.


GPG-Key:

pub 1024D/15ABDA78 2004-10-17 Stefan Esser <stefan.esser@sektioneins.de>
Key fingerprint = 7806 58C8 CFA8 CE4A 1C2C 57DD 4AE1 795E 15AB DA78


Copyright 2008 SektionEins GmbH. All rights reserved.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkk3qT4ACgkQSuF5XhWr2nho0QCgi6JABGlJUbf7Z3eR61J7KQMH
JhoAnRBzGsfci/OsDBEVtv+UBE2UZ+I1
=X9Yi
-----END PGP SIGNATURE-----
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
    16 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