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

Hardened-PHP Project Security Advisory 2005-20.79

Hardened-PHP Project Security Advisory 2005-20.79
Posted Nov 1, 2005
Authored by Stefan Esser, Hardened-PHP Project | Site hardened-php.net

During the development of the Hardening-Patch which adds security hardening features to the PHP codebase, several vulnerabilities within PHP were discovered. This advisory describes one of these flaws concerning a weakness in the file upload code, that allows overwriting the GLOBALS array when register_globals is turned on. Overwriting this array can lead to unexpected security holes in code assumed secure. This vulnerability can allow for remote PHP code execution. Affected versions are PHP4 versions 4.4.0 and below and PHP5 versions 5.0.5 and below.

tags | advisory, remote, php, vulnerability, code execution, file upload
SHA-256 | f8dc972de9ab9723e24e079bb1aa1db52acccf6b34d75a662360600fa9ba97a0

Hardened-PHP Project Security Advisory 2005-20.79

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


Hardened-PHP Project
www.hardened-php.net

-= Security Advisory =-


Advisory: PHP File-Upload $GLOBALS Overwrite Vulnerability
Release Date: 2005/10/31
Last Modified: 2005/10/31
Author: Stefan Esser [sesser@hardened-php.net]

Application: PHP4 <= 4.4.0
PHP5 <= 5.0.5
Severity: $GLOBALS overwrite can lead to unexpected behaviour
of PHP applications, which can lead to execution of
remote PHP code in many situations
Risk: Critical
Vendor Status: Vendor has released a bugfixed PHP 4 version
References: https://www.hardened-php.net/advisory_202005.79.html
https://www.hardened-php.net/globals-problem


Overview:

PHP is a widely-used general-purpose scripting language that is
especially suited for Web development and can be embedded into HTML.

During the development of the Hardening-Patch which adds security
hardening features to the PHP codebase, several vulnerabilities
within PHP were discovered. This advisory describes one of these
flaws concerning a weakness in the file upload code, that allows
overwriting the GLOBALS array when register_globals is turned on.
Overwriting this array can lead to unexpected security holes in
code assumed secure.

This vulnerability has consequences for a lot of PHP applications
f.e. everything based on PEAR.php and vBulletin. And can lead to
remote PHP code execution.

For a detailed explanation of the $GLOBALS overwrite problem, have
a look at the following article which describes it in more detail:

https://www.hardened-php.net/globals-problem


Details:

In PHP 4.3.11 some code was added to disallow overwriting the
$GLOBALS array when register_globals is turned on. Unfortunately
there was a hole in this protection. The introduced code did only
affect the globalisation of the GET, POST and COOKIE variables.
However it was overseen, that the rfc1867 file upload code within
PHP also registers global variables, which can be used by an
attacker to overwrite the $GLOBALS array by simply sending a
multipart/form-data POST request containing a fileupload field
with the name 'GLOBALS'.

Until now it was not realised, how dangerous the problem is. This
is also one of the reasons why all PHP <= 4.3.10 packages shipped
with various distributions are still vulnerable to the normal
$GLOBALS overwrite, which was fixed in PHP 4.3.11.

Describing the impact of $GLOBALS overwrite vulnerabilities and
why it does not only affect installations, where register_globals
is turned on, why it allows remote code execution in a lot of
PHP applications and why this is also a threat for applications
that allow local file includes and are running in a SAFE_MODE or
open_basedir environment is out of the scope of this advisory.

The interested reader is advised to read the following article,
that describes this "new" bugclass a bit more detailed, with
examples.

https://www.hardened-php.net/globals-problem

Finally it should be noted that users of our Hardening-Patch for
PHP are not affected if they run the at least version from
September.


Proof of Concept:

The Hardened-PHP project is not going to release exploits for any
of these vulnerabilities to the public.


Recommendation:

It is strongly recommended to upgrade to the new PHP-Releases as
soon as possible, because the GLOBALS problem is very dangerous
to a lot of PHP applications in the wild. Especially because
writing a worm that f.e. uses this problem to exploit everything
based on PEAR.php is very simple. Additionally we always recommend
to run PHP with the Hardening-Patch applied, especially because
it offers even more protection against $GLOBALS overwrites than
the default PHP.


GPG-Key:

https://www.hardened-php.net/hardened-php-signature-key.asc

pub 1024D/0A864AA1 2004-04-17 Hardened-PHP Signature Key
Key fingerprint = 066F A6D0 E57E 9936 9082 7E52 4439 14CC 0A86 4AA1


Copyright 2005 Stefan Esser. All rights reserved.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see https://www.gnupg.org

iD8DBQFDZh0fRDkUzAqGSqERAo5yAJ0fNc8IZKgAdhGf7VkuzcubwN0+2ACfWK8K
IZXWzIMzQMf2DEc2ktRgOHQ=
=X87Q
-----END PGP SIGNATURE-----

Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close