SecurityAlert : 4684 CVE : CVE-NO-MATCH SecurityRisk : Medium (About) Remote Exploit : No Local Exploit : Yes Victim interaction required : No Exploit Available : No Credit : Stefan Esser Published : 05.12.2008
Affected Software :
PHP 5.2.6
Advisory Content :
-----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
If you have additional information or notice any errors regarding this security advisory, please use contact form or email us at info()securityreason()com.