PHP het is weer eens lek

Pagina: 1
Acties:

  • Vaagharses
  • Registratie: Maart 2001
  • Laatst online: 22-12-2022
een snelle bug melding :)

[url="http://security.e-matters.de/advisories/022002.html"]http://security.e-matters.de/advisories/022002.html[/url]

dus updaten met zijn allen
Advisory 02/2002 PHP remote vulnerability


Release Date: 2002/07/22
Author: Stefan Esser [s.esser@ematters.de]
Application: PHP 4.2.0, 4.2.1
Severity: A vulnerability within the multipart/form-data handler could allow remote compromise of the web server.
Risk: Critical
Reference: [url="http://security.e-matters.de/advisories/012002.html"]http://security.e-matters.de/advisories/012002.html[/url]
Last Modified: 2002/07/22



Overview

We have discovered a serious vulnerability within the default version of PHP. Depending on the processor architecture it may be possible for a remote attacker to either crash or compromise the web server.


Details

PHP 4.2.0 introduced a completely rewritten multipart/form-data POST handler. While I was working on the code in my role as PHP developer i found a bug within the way the mime headers are processed. A malformed POST request can trigger an error condition, that is not correctly handled. Due to this bug it could happen that an uninitialised struct gets appended to the linked list of mime headers. When the lists gets cleaned or destroyed PHP tries to free the pointers that are expected in the struct. Because of the lack of initialisation those pointers contain stuff that was left on the stack by previous function calls.

On the IA32 architecture (aka. x86) it is not possible to control what will end up in the uninitialised struct because of the stack layout. All possible code paths leave illegal addresses within the struct and PHP will crash when it tries to free them.

Unfortunately the situation is absolutely different if you look on a solaris sparc installation. Here it is possible for an attacker to free chunks of memory that are full under his control. This is most probably the case for several more non IA32 architectures.

Please note that exploitability is not only limited to systems that are running malloc()/free() implementations that are known to be vulnerable to control structure overwrites. This is because the internal PHP memory managment implements its own linked list system that can be used to overwrite nearly arbitrary memory addresses.


Proof of Concept

e-matters is not going to release the exploit for this vulnerability to the public.


Vendor Response

22 July 2002 An updated version of PHP which fixes this vulnerability was released and can be downloaded at:

[url="http://www.php.net/downloads.php"]http://www.php.net/downloads.php[/url]

The vendor announcement is available at:

[url="http://www.php.net/release_4_2_2.php"]http://www.php.net/release_4_2_2.php[/url]



Recommendation

If you are running PHP 4.2.x you should upgrade as soon as possible, especially if your server runs on a non IA32 CPU. If you cannot upgrade for whatever reason the only way to workaround this, is to disable all kinds of POST requests on your server.

Anti Geluidsmuur Front Amstelveen telt 17.800 lantaarnpalen; hoeveel heeft jouw gemeente?


Verwijderd

[url="http://www.php.net"]www.php.net[/url] lijkt down...

Verwijderd

Hmm, dus op x86 crasht de webserver met als er gebruik van de exploit wordt gemaakt, en op non-x86 kun je er ws. op inbreken.
Terwijl dit de enige versie (4.2.0, 4.2.1) was die geen last had van de file-upload bug (toch?).

Verwijderd

mirrors:

php.localhost.nl
nl.php.net
php.vuurwerk.nl

  • ViNyL
  • Registratie: Augustus 2001
  • Niet online
Het lijkt er op php.net op of iemand de vulnerabilty maar ff heeft toegepast :)

  • LollieStick
  • Registratie: Juni 2001
  • Laatst online: 20-05 23:59
Op maandag 22 juli 2002 16:22 schreef ViNyL het volgende:
Het lijkt er op php.net op of iemand de vulnerabilty maar ff heeft toegepast :)
lol... neem aan dat ze daar toch wel de nieuwste versie draaien :7

  • igmar
  • Registratie: April 2000
  • Laatst online: 29-06 18:56

igmar

ISO20022

lol... neem aan dat ze daar toch wel de nieuwste versie draaien :7
Ze hebben een bandbreedte probleem, en een server met een beetje te hoge load.

  • Mark
  • Registratie: Juni 1999
  • Laatst online: 08-08 09:24
Op de mirror van Widexs is de laatste versie in ieder geval te vinden:

Sources: [url="ftp://php.widexs.nl/pub/php/distributions/php-4.2.2.tar.gz"]ftp://php.widexs.nl/pub/php/distributions/php-4.2.2.tar.gz[/url]

Win32 binaries: [url="ftp://php.widexs.nl/pub/php/distributions/php-4.2.2-Win32.zip"]ftp://php.widexs.nl/pub/php/distributions/php-4.2.2-Win32.zip[/url]

  • _JGC_
  • Registratie: Juli 2000
  • Laatst online: 02:36
Hehe, dat is dus de reden waarom Debian het nog steeds bij 4.1.2 houdt in Woody :)

  • Seth4Chaos
  • Registratie: Maart 2001
  • Niet online

Seth4Chaos

that's me...

Op maandag 22 juli 2002 17:51 schreef _JGC_ het volgende:
Hehe, dat is dus de reden waarom Debian het nog steeds bij 4.1.2 houdt in Woody :)
ik zat al te wachten op een mailtje van me server maar nix...ff nagekeken en idd 4.1.2 :)

Mistakes are proof that you are trying...


  • chem
  • Registratie: Oktober 2000
  • Laatst online: 04-08 07:59

chem

Reist de wereld rond

MacOS X precompiled: [url="http://www.entropy.ch/software/macosx/php/"]http://www.entropy.ch/software/macosx/php/[/url]

(ook voor MySQL en allerlei andere zut)

Klaar voor een nieuwe uitdaging.


Verwijderd

Op maandag 22 juli 2002 16:56 schreef LinuxUser het volgende:

[..]

lol... neem aan dat ze daar toch wel de nieuwste versie draaien :7
[url="http://www.php.net"]www.php.net[/url] draait zelf versie 4.3.0-dev.
Pagina: 1