Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 02-28-2002, 07:26 AM   #1
Registered: Jul 2001
Location: London
Distribution: RH 9
Posts: 151

Rep: Reputation: 30
PHP vulnerability

Heres the linkl.

There's a vunlerability with file uploads with Apache/PHP on Linux machines apparentley!

Old 02-28-2002, 04:58 PM   #2
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Thnx, Ill tack on a wee bit more info from ISS X-Force's mailinglist, cuz it handles more info compared to the link.

Internet Security Systems Security Alert
February 27, 2002

Multiple PHP Vulnerabilities: Remote Compromise Exploit in Circulation


ISS X-Force has learned of multiple buffer overflow vulnerabilities
present in the PHP (Hypertext Preprocessor) scripting language. PHP is a
popular server-side scripting language that is used heavily throughout
the Internet. PHP is most commonly used in Apache Web server
environments, but it is supported by all major Web servers and operating
systems. X-Force has verified that a functional exploit for one of the
vulnerabilities exists and may be actively circulating in the computer


Netcraft reports that as of January 2002, there are over 20.8 million
active Apache installations, which account for 57% of the sites
surveyed. Secure Space reports that PHP is the most popular Apache
module available and there are over 1.44 million active installations.

Affected Platforms:

PHP version 3.10-3.18
PHP version 4.0.1-4.03pl1
PHP version 4.0.2-4.05
PHP version 4.0.6-4.0.7RC2
PHP version 4.0.7RC3-4.1.1

The PHP 4.2.0-dev distribution is not vulnerable.


The PHP project began as an Apache Software Foundation project as a
powerful, cross-platform, server-side, embedded scripting language. PHP
code is included inline among common HTML scripting, and its commands
are executed on the server, unlike JavaScript, which is executed on the
client. PHP is an attractive alternative for Web developers who are
interested in creating dynamic content because it is considered easy to
work with, very fast, and extremely flexible.

PHP supports file uploads via HTTP POST by any RFC-1867 compliant Web
browser. This feature allows Web site visitors to upload files,
scripting, or any type of content to the server, where it can then be
stored, displayed, or operated upon, depending on the design of the
server. This feature is considered a potential security risk and many
security mechanisms have been added to PHP over time to limit its abuse.

Multiple buffer overflow vulnerabilities exist within the HTTP POST file
upload functionality. To successfully exploit these vulnerabilities,
attackers must upload a PHP form containing specially crafted MIME
encoded data. In the exploit X-Force has analyzed, this data is passed
in a buffer to a routine that locates the MIME boundary. A pointer is
set to point to the end of the boundary, and then the "Content-
disposition" header is parsed. A logic flaw in the parsing routine may
cause PHP to miscalculate the remaining byte count within the allocated
buffer. Under certain circumstances, this may lead to a one-byte
overflow within the heap memory management data.

Heap overflows are inherently difficult to exploit because the nature of
the memory heap is much more dynamic then that of the stack. The
environment of the heap management system must be favorable to the
attacker to successfully exploit this vulnerability. Web servers are
constantly allocating more memory dynamically and are serving many
clients at any given time. This environment is quite chaotic and
decreases the chances of successful exploitation in real-world

X-Force has analyzed and tested a functional exploit. This exploit is
believed to be circulating in the underground community and in use to a
limited degree. It contains nine separate exploit vectors for versions
of Debian and Red Hat Linux running various versions of Apache Web
server and PHP. X-Force predicts newer versions of this exploit may
support exploit vectors covering additional operating systems.


The exploit that X-Force has analyzed appears to be an early version,
and is somewhat unreliable. X-Force has been able to compromise remote
servers with this current exploit in a lab environment. Newer and more
effective versions may be circulating as well.

The maintainers of PHP have updated the PHP CVS source code repository
to fix this vulnerability. X-Force recommends that Web site
administrators upgrade to the latest versions available for their PHP
distributions. PHP downloads are available at:

The vulnerability associated with the exploit has been fixed in the file
"php4/main/rfc1867.c". PHP4 administrators should verify that the
revision of this file is or higher. The latest PHP version
4.1.2 packages contain the patched version of "rfc1867.c".

As a workaround, the file upload support can be disabled on Web servers
running PHP 4.0.3 or above. Open the php.ini file and modify the line
file_uploads = On to file_uploads = Off. After modifying the php.ini
file, the Web server must be restarted if PHP is running as module.

An X-Press Update for RealSecure Network Sensor will be available soon
to provide detection support for these vulnerabilities. An Internet
Scanner Flex Check will be released today to find vulnerable versions of
PHP. These updates will be available at the ISS Download Center at:

Additional Information:

Advisory: PHP remote vulnerabilities,

PHP Downloads,

Apache Module Report,


ISS X-Force Database,

ISS Download Center,

This alert is available at:
[Note: It may take up to 24 hours from the original posting of this
alert for it to appear on the Web site.]


ISS would like to thank Snort for providing the exploit for this


About Internet Security Systems (ISS)
Founded in 1994, Internet Security Systems (ISS) (Nasdaq: ISSX) is a
pioneer and world leader in software and services that protect critical
online resources from an ever-changing spectrum of threats and misuse.
Internet Security Systems is headquartered in Atlanta, GA, with
additional operations throughout the Americas, Asia, Australia, Europe
and the Middle East.

Copyright (c) 2002 Internet Security Systems, Inc. All rights reserved

Permission is hereby granted for the electronic redistribution of this
document. It is not to be edited or altered in any way without the
express written consent of the Internet Security Systems X-Force. If you
wish to reprint the whole or any part of this document in any other
medium excluding electronic media, please email for

Disclaimer: The information within this paper may change without notice.
Use of this information constitutes acceptance for use in an AS IS
condition. There are NO warranties, implied or otherwise, with regard to
this information or its use. Any use of this information is at the
user's risk. In no event shall the author/distributor (Internet Security
Systems X-Force) be held liable for any damages whatsoever arising out
of or in connection with the use or spread of this information.

X-Force PGP Key available on MIT's PGP key server and's key
server, as well as at

Please send suggestions, updates, and comments to: X-Force of Internet Security Systems, Inc.

Version: 2.6.3a
Charset: noconv

Old 03-01-2002, 01:31 PM   #3
LQ Newbie
Registered: Mar 2002
Distribution: Slackware 8.1
Posts: 9

Rep: Reputation: 0
Am I vulnerable?

All I have ever installed is the default apache rpm that comes with redhat 7.2 and a patch to 1.3.22 apache. Nothing else, so my question is am I vulnerable to some exploit now or do I have to take no action as I have not atleast myself intalled any PHP things only the apache rpm:s

EDIT: Also i have no PHP scripts running. no .php. nothing.

Last edited by etfetius; 03-01-2002 at 01:46 PM.
Old 03-02-2002, 06:47 AM   #4
Registered: Feb 2002
Distribution: ubuntu
Posts: 76

Rep: Reputation: 15
Re: Am I vulnerable?

Originally posted by etfetius
EDIT: Also i have no PHP scripts running. no .php. nothing.
Well, as it is an php exploit, no you don't have to take any actions... if you ever plan to be running php scripts on your server make sure u have an updated and thus secure version of php ;-)



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
WARN PHP Vulnerability Capt_Caveman Linux - Security 0 07-04-2005 05:38 PM
2.6 DoS Vulnerability! /bin/bash Linux - Security 12 06-03-2005 07:45 PM
Java vulnerability BrianMC SUSE / openSUSE 1 11-25-2004 03:40 PM
Vulnerability Scanner? AquamaN Linux - Software 8 07-22-2003 12:03 PM
UPnP vulnerability in XP anoop_chandran General 13 01-08-2002 01:01 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration