Exploit the possiblities

PHP 4.2.0 / 4.2.1 Remote Compromise / Denial Of Service

PHP 4.2.0 / 4.2.1 Remote Compromise / Denial Of Service
Posted Oct 27, 2017
Authored by Stefan Esser

PHP versions 4.2.0 and 4.2.1 suffer from an issue where depending on the processor architecture it may be possible for a remote attacker to either crash or compromise the web server.

tags | advisory, remote, web, denial of service, php
MD5 | e966da86f2a1eebadb8468cec478394a

PHP 4.2.0 / 4.2.1 Remote Compromise / Denial Of Service

Change Mirror Download
                           e-matters GmbH

-= Security Advisory =-

Advisory: Remote Compromise/DOS Vulnerability in PHP
Release Date: 2002/07/22
Last Modified: 2002/07/22
Author: Stefan Esser [s.esser@e-matters.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
Vendor Status: Patches Released.
Reference: http://security.e-matters.de/advisories/022002.html


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.


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 uninit-
ialised 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:

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


The vendor announcement is available at:



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.



pub 1024D/75E7AAD6 2002-02-26 e-matters GmbH - Securityteam
Key fingerprint = 43DD 843C FAB9 832A E5AB CAEB 81F2 8110 75E7 AAD6

Copyright 2002 Stefan Esser. All rights reserved.


RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

Want To Donate?

Bitcoin: 18PFeCVLwpmaBuQqd5xAYZ8bZdvbyEWMmU

File Archive:

March 2018

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

Top Authors In Last 30 Days

File Tags


packet storm

© 2018 Packet Storm. All rights reserved.

Security Services
Hosting By