Australia's Leading Computer Emergency Response Team

ESB-2002.101 -- CERT Advisory CA-2002-05 -- Multiple Vulnerabilities in PHP fileupload
Date: 28 February 2002
Original URL:
References: ESB-2002.102  ESB-2002.108  ESB-2002.110  ESB-2002.152  ESB-2002.166  

Click here for PGP verifiable version

             AUSCERT External Security Bulletin Redistribution

                 ESB-2002.101 -- CERT Advisory CA-2002-05
                Multiple Vulnerabilities in PHP fileupload
                             28 February 2002


        AusCERT Security Bulletin Summary

Product:                PHP (php_mime_split function)
Platform:               Web servers running PHP
Impact:                 Execute Arbitrary Code/Commands
                        Denial of Service
Access Required:        Remote

- --------------------------BEGIN INCLUDED TEXT--------------------


CERT Advisory CA-2002-05 Multiple Vulnerabilities in PHP fileupload

   Original release date: February 27, 2002
   Last revised: --
   Source: CERT/CC

   A complete revision history can be found at the end of this file.

Systems Affected

     * Web servers running PHP


   Multiple  vulnerabilities  exist  in the PHP scripting language. These
   vulnerabilities  could  allow  a  remote attacker to execute arbitrary
   code with the privileges of the PHP process.

I. Description

   PHP is a scripting language widely used in web development. PHP can be
   installed on a variety of web servers, including Apache, IIS, Caudium,
   Netscape  and  iPlanet,  OmniHTTPd  and others. Vulnerabilities in the
   php_mime_split  function  may  allow  an intruder to execute arbitrary
   code  with  the  privileges of the web server. For additional details,

   Web  servers  that  do not have PHP installed are not affected by this

   The  CERT/CC  is tracking this set of vulnerabilities as VU#297363. At
   this  time,  these  vulnerabilities  have  not  been  assigned  a  CVE

II. Impact

   Intruders  can  execute  arbitrary code with the privileges of the web
   server, or interrupt normal operations of the web server.

III. Solution

Apply a Patch

   Upgrade to PHP version 4.1.2, available from

   If   upgrading   is  not  possible,  apply  patches  as  described  at
   * For PHP 4.10/4.11
   * For PHP 4.06
   * For PHP 3.0

   If  you  are  using  version  4.20-dev,  you  are not affected by this
   vulnerability. Quoting from

     "[U]sers  running  PHP 4.2.0-dev from cvs are not vulnerable to any
     of  the  described  bugs  because the fileupload code was completly
     rewritten for the 4.2.0 branch."

Disable fileuploads

   If  upgrading  is  not  possible or a patch cannot be applied, you can
   avoid  these vulnerabilities by disabling fileupload support. Edit the
   PHP configuration file php.ini as follows:

     file_uploads = off

   Note  that  this  setting  only  applies  to  version 4.0.3 and above.
   However,  this  will prevent you from using fileuploads, which may not
   be acceptable in your environment.

Appendix A. - Vendor Information

   This  appendix  contains  information  provided  by  vendors  for this
   advisory.  When  vendors  report  new  information  to the CERT/CC, we
   update this section and note the changes in our revision history. If a
   particular  vendor  is  not  listed  below, we have not received their

Apache Software Foundation

   Information    about    this    vulnerability    is   available   from


   FreeBSD  does not include any version of PHP by default, and so is not
   vulnerable.  However,  the  FreeBSD Ports Collection does contain both
   PHP3  and  PHP4  packages. Updates to the PHP packages are in progress
   and corrected packages will be available in the near future.


   MandrakeSoft distributes PHP in all distributions and we are currently
   working  on  patching  our  versions of PHP for Linux-Mandrake 7.1 and
   7.2;  Mandrake  Linux  8.0, 8.0/ppc, 8.1, and 8.1/ia64; Single Network
   Firewall 7.2; Corporate Server 1.0.1.

   We anticipate having the updates out by the end of the week.


   We do not use PHP in any products.


   NCSA  does  not  include  PHP as an add-in or bundled component in any
   products distributed.

Red Hat

   Red  Hat  was  notified  of  this  issue  on  27th  February 2002. All
   supported  versions  of  Red Hat Linux ship with PHP packages that are
   affected by these vulnerabilities. We will shortly be releasing errata
   packages  which  contain patched versions that are not vulnerable. The
   errata  packages and our advisory will be available on our web site at
   the  URL  below. At the same time users of the Red Hat Network will be
   able  to  update  their  systems to patched versions using the up2date


   The  CERT Coordination Center thanks Stefan Esser, upon whose advisory
   this document is largely based.

   Author: Shawn V. Hernan

Appendix B. - References


   This document is available from:

CERT/CC Contact Information

          Phone: +1 412-268-7090 (24-hour hotline)
          Fax: +1 412-268-6989
          Postal address:
          CERT Coordination Center
          Software Engineering Institute
          Carnegie Mellon University
          Pittsburgh PA 15213-3890

   CERT/CC   personnel   answer  the  hotline  08:00-17:00  EST(GMT-5)  /
   EDT(GMT-4)  Monday  through  Friday;  they are on call for emergencies
   during other hours, on U.S. holidays, and on weekends.

    Using encryption

   We  strongly  urge you to encrypt sensitive information sent by email.
   Our public PGP key is available from

   If  you  prefer  to  use  DES,  please  call the CERT hotline for more

    Getting security information

   CERT  publications  and  other security information are available from
   our web site

   To  subscribe  to  the CERT mailing list for advisories and bulletins,
   send  email  to Please include in the body of your

   subscribe cert-advisory

   *  "CERT"  and  "CERT  Coordination Center" are registered in the U.S.
   Patent and Trademark Office.

   Any  material furnished by Carnegie Mellon University and the Software
   Engineering  Institute  is  furnished  on  an  "as is" basis. Carnegie
   Mellon University makes no warranties of any kind, either expressed or
   implied  as  to  any matter including, but not limited to, warranty of
   fitness  for  a  particular purpose or merchantability, exclusivity or
   results  obtained from use of the material. Carnegie Mellon University
   does  not  make  any warranty of any kind with respect to freedom from
   patent, trademark, or copyright infringement.

   Conditions for use, disclaimers, and sponsorship information

   Copyright 2002 Carnegie Mellon University.

   Revision History
February 27, 2002:  Initial release

Version: PGP 6.5.8


- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to
and we will forward your request to the appropriate person.

This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content.  The decision to use any or all of this information is
the responsibility of each user or organisation, and should be done so in
accordance with site policies and procedures.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the original authors to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

If you believe that your system has been compromised, contact AusCERT or
your representative in FIRST (Forum of Incident Response and Security

Internet Email:
Facsimile:	(07) 3365 7031
Telephone:	(07) 3365 4417 (International: +61 7 3365 4417)
		AusCERT personnel answer during Queensland business hours
		which are GMT+10:00 (AEST).
		On call after hours for emergencies.

Version: 2.6.3i
Charset: noconv