SecurityTracker.com
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 


Category:   Application (Generic)  >   PHP Vendors:   PHP Group
(Gentoo Issues Fix) PHP Integer Overflows in pack() and unpack() and Bugs in realpath() and unserialize() May Allow Users to Bypass safe_mode and Execute Arbitrary Code
SecurityTracker Alert ID:  1012620
SecurityTracker URL:  http://securitytracker.com/id/1012620
CVE Reference:   CVE-2004-1018, CVE-2004-1019, CVE-2004-1063, CVE-2004-1064   (Links to External Site)
Date:  Dec 19 2004
Impact:   Execution of arbitrary code via local system, Execution of arbitrary code via network, User access via local system, User access via network
Fix Available:  Yes  Vendor Confirmed:  Yes  
Version(s): prior to 4.3.10 and 5.0.3
Description:   Several vulnerabilities were reported in PHP. A local or remote user may be able to execute arbitrary code on the target system.

Stefan Esser of the Hardened-PHP Project reported a variety of vulnerabilities affecting PHP.

It is reported that the pack() and unpack() functions contain integer overflows [CVE: CVE-2004-1018]. A user may be able to supply specially crafted inputs to bypass safe_mode restrictions and execute arbitrary code with the privileges of the target web service.

It is also reported that a local user can bypass the safe_mode_exec_dir settings when safe_mode is enabled on a multithreaded UNIX/Linux web server by injecting shell commands into the name of the current directory [CVE: CVE-2004-1063].

It is also reported that a path truncation flaw in realpath() allows a user to bypass safe_mode restrictions or to include arbitrary files in certain cases [CVE: CVE-2004-1064].

Two vulnerabilities were reported in the unserialize() function [CVE: CVE-2004-1019]. Negative references or incorrect processing of references may free arbitrary memory addresses, causing arbitrary code to be executed. If a PHP application provides remote user-input to the unserialize() function, these bugs may be exploitable by remote users.

The original advisory is available at:

http://www.hardened-php.net/advisories/012004.txt

Impact:   A local or remote user may be able to execute arbitrary code on the target system.
Solution:   Gentoo has released a fix and indicatest that all PHP users should upgrade to the latest version:

# emerge --sync
# emerge --ask --oneshot --verbose ">=dev-php/php-4.3.10"

All mod_php users should upgrade to the latest version:

# emerge --sync
# emerge --ask --oneshot --verbose ">=dev-php/mod_php-4.3.10"

All php-cgi users should upgrade to the latest version:

# emerge --sync
# emerge --ask --oneshot --verbose ">=dev-php/php-cgi-4.3.10"

Vendor URL:  www.php.net/ (Links to External Site)
Cause:   Boundary error, Input validation error
Underlying OS:  Linux (Gentoo)

Message History:   This archive entry is a follow-up to the message listed below.
Dec 16 2004 PHP Integer Overflows in pack() and unpack() and Bugs in realpath() and unserialize() May Allow Users to Bypass safe_mode and Execute Arbitrary Code



 Source Message Contents

Subject:  [gentoo-announce] [ GLSA 200412-14 ] PHP: Multiple vulnerabilities


This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigF127259744D06E8FA13B40B6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Gentoo Linux Security Advisory                           GLSA 200412-14
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                            http://security.gentoo.org/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  Severity: High
     Title: PHP: Multiple vulnerabilities
      Date: December 19, 2004
      Bugs: #74547
        ID: 200412-14

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Synopsis
========

Several vulnerabilities were found and fixed in PHP, ranging from an
information leak and a safe_mode restriction bypass to a potential
remote execution of arbitrary code.

Background
==========

PHP is a general-purpose scripting language widely used to develop
web-based applications. It can run inside a web server using the
mod_php module or the CGI version of PHP, or can run stand-alone in a
CLI.

Affected packages
=================

    -------------------------------------------------------------------
     Package          /  Vulnerable  /                      Unaffected
    -------------------------------------------------------------------
  1  dev-php/php          < 4.3.10                           >= 4.3.10
  2  dev-php/mod_php      < 4.3.10                           >= 4.3.10
  3  dev-php/php-cgi      < 4.3.10                           >= 4.3.10
    -------------------------------------------------------------------
     3 affected packages on all of their supported architectures.
    -------------------------------------------------------------------

Description
===========

Stefan Esser and Marcus Boerger reported several different issues in
the unserialize() function, including serious exploitable bugs in the
way it handles negative references (CAN-2004-1019).

Stefan Esser also discovered that the pack() and unpack() functions are
subject to integer overflows that can lead to a heap buffer overflow
and a heap information leak. Finally, he found that the way
multithreaded PHP handles safe_mode_exec_dir restrictions can be
bypassed, and that various path truncation issues also allow to bypass
path and safe_mode restrictions.

Ilia Alshanetsky found a stack overflow issue in the exif_read_data()
function (CAN-2004-1065). Finally, Daniel Fabian found that addslashes
and magic_quotes_gpc do not properly escape null characters and that
magic_quotes_gpc contains a bug that could lead to one level directory
traversal.

Impact
======

These issues could be exploited by a remote attacker to retrieve web
server heap information, bypass safe_mode or path restrictions and
potentially execute arbitrary code with the rights of the web server
running a PHP application.

Workaround
==========

There is no known workaround at this time.

Resolution
==========

All PHP users should upgrade to the latest version:

    # emerge --sync
    # emerge --ask --oneshot --verbose ">=dev-php/php-4.3.10"

All mod_php users should upgrade to the latest version:

    # emerge --sync
    # emerge --ask --oneshot --verbose ">=dev-php/mod_php-4.3.10"

All php-cgi users should upgrade to the latest version:

    # emerge --sync
    # emerge --ask --oneshot --verbose ">=dev-php/php-cgi-4.3.10"

References
==========

  [ 1 ] PHP 4.3.10 Release Announcement
        http://www.php.net/release_4_3_10.php
  [ 2 ] Hardened-PHP Security Advisory
        http://www.hardened-php.net/advisories/012004.txt
  [ 3 ] SEC Consult Advisory

http://www.securityfocus.com/archive/1/384663/2004-12-15/2004-12-21/0
  [ 4 ] CAN-2004-1019
        http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-1019
  [ 5 ] CAN-2004-1065
        http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-1065

Availability
============

This GLSA and any updates to it are available for viewing at
the Gentoo Security Website:

  http://security.gentoo.org/glsa/glsa-200412-14.xml

Concerns?
=========

Security is a primary focus of Gentoo Linux and ensuring the
confidentiality and security of our users machines is of utmost
importance to us. Any security concerns should be addressed to
security@gentoo.org or alternatively, you may file a bug at
http://bugs.gentoo.org.

License
=======

Copyright 2004 Gentoo Foundation, Inc; referenced text
belongs to its owner(s).

The contents of this document are licensed under the
Creative Commons - Attribution / Share Alike license.

http://creativecommons.org/licenses/by-sa/2.0


--------------enigF127259744D06E8FA13B40B6
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBxYjvvcL1obalX08RAtCSAKCckmvGqf2hm29A7BODn1GA1EInAwCfaO51
qGHqhdqStq1aRIns4LeP9As=
=/7FC
-----END PGP SIGNATURE-----

--------------enigF127259744D06E8FA13B40B6--

 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2019, SecurityGlobal.net LLC