ID CVE-2006-4812
Summary Integer overflow in PHP 5 up to 5.1.6 and 4 before 4.3.0 allows remote attackers to execute arbitrary code via an argument to the unserialize PHP function with a large value for the number of array elements, which triggers the overflow in the Zend Engine ecalloc function (Zend/zend_alloc.c).
Vulnerable Configurations
  • PHP 4.0.0
  • PHP PHP 4.0.1
  • cpe:2.3:a:php:php:4.0.1:patch1
  • cpe:2.3:a:php:php:4.0.1:patch2
  • PHP PHP 4.0.2
  • PHP PHP 4.0.3
  • cpe:2.3:a:php:php:4.0.3:patch1
  • PHP PHP 4.0.4
  • PHP PHP 4.0.5
  • PHP PHP 4.0.6
  • PHP PHP 4.0.7
  • cpe:2.3:a:php:php:4.0.7:rc1
  • cpe:2.3:a:php:php:4.0.7:rc2
  • cpe:2.3:a:php:php:4.0.7:rc3
  • PHP PHP 4.1.0
  • PHP PHP 4.1.1
  • PHP PHP 4.1.2
  • cpe:2.3:a:php:php:4.2:-:dev
  • PHP PHP 4.2.0
  • PHP PHP 4.2.1
  • PHP PHP 4.2.2
  • PHP PHP 4.2.3
  • cpe:2.3:a:php:php:5.0:rc1
  • cpe:2.3:a:php:php:5.0:rc2
  • cpe:2.3:a:php:php:5.0:rc3
  • PHP PHP 5.0.0
  • PHP PHP 5.0.1
  • PHP PHP 5.0.2
  • PHP PHP 5.0.3
  • PHP PHP 5.0.4
  • PHP PHP 5.0.5
  • PHP PHP 5.1.0
  • PHP PHP 5.1.1
  • PHP PHP 5.1.2
  • PHP PHP 5.1.3
  • PHP 5.1.4
  • PHP PHP 5.1.5
  • PHP PHP 5.1.6
Base: 10.0 (as of 10-10-2006 - 09:45)
  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf ( http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
  • Manipulating User-Controlled Variables
    This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An attacker can override environment variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the attacker can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.
exploit-db via4
description PHP 3-5 ZendEngine ECalloc Integer Overflow Vulnerability. CVE-2006-4812. Remote exploit for php platform
id EDB-ID:28760
last seen 2016-02-03
modified 2006-10-05
published 2006-10-05
reporter anonymous
title PHP 3-5 ZendEngine ECalloc Integer Overflow Vulnerability
nessus via4
  • NASL family SuSE Local Security Checks
    description The ini_restore() method could be exploited to reset options set in the webserver config to their default values (CVE-2006-4625). The memory handling routines contained an integer overflow (CVE-2006-4812).
    last seen 2019-02-21
    modified 2018-07-19
    plugin id 27147
    published 2007-10-17
    reporter Tenable
    title openSUSE 10 Security Update : apache2-mod_php5 (apache2-mod_php5-2153)
  • NASL family SuSE Local Security Checks
    description The ini_restore() method could be exploited to reset options set in the webserver config to their default values. (CVE-2006-4625) The memory handling routines contained an integer overflow. (CVE-2006-4812)
    last seen 2019-02-21
    modified 2012-05-17
    plugin id 29375
    published 2007-12-13
    reporter Tenable
    title SuSE 10 Security Update : PHP (ZYPP Patch Number 2152)
  • NASL family Red Hat Local Security Checks
    NASL id REDHAT-RHSA-2006-0708.NASL
    description Updated PHP packages that fix an integer overflow flaw are now available for Red Hat Enterprise Linux 2.1. This update has been rated as having important security impact by the Red Hat Security Response Team. PHP is an HTML-embedded scripting language commonly used with the Apache HTTP Web server. An integer overflow was discovered in the PHP memory handling routines. If a script can cause memory allocation based on untrusted user data, a remote attacker sending a carefully crafted request could execute arbitrary code as the 'apache' user. (CVE-2006-4812) This issue did not affect the PHP packages distributed with Red Hat Enterprise Linux 3 or 4. Users of PHP should upgrade to these updated packages which contain a backported patch that corrects this issue.
    last seen 2019-02-21
    modified 2018-11-16
    plugin id 22524
    published 2006-10-10
    reporter Tenable
    title RHEL 2.1 : php (RHSA-2006:0708)
  • NASL family CGI abuses
    description The remote host is running a version of PHP 4.x older than 4.3.0. As such, it reportedly has an integer overflow in array creation that can be triggered by user-input passed to an 'unserialize()' function. Successful exploitation of this vulnerability could allow an attacker to execute arbitrary code on this host.
    last seen 2019-02-21
    modified 2018-07-24
    plugin id 17796
    published 2012-01-11
    reporter Tenable
    title PHP 4.x < 4.3.0 ZendEngine Integer Overflow
  • NASL family FreeBSD Local Security Checks
    NASL id FREEBSD_PKG_E329550B54F711DBA5AE00508D6A62DF.NASL
    description Stefan Esser reports : The PHP 5 branch of the PHP source code lacks the protection against possible integer overflows inside ecalloc() that is present in the PHP 4 branch and also for several years part of our Hardening-Patch and our new Suhosin-Patch. It was discovered that such an integer overflow can be triggered when user input is passed to the unserialize() function. Earlier vulnerabilities in PHP's unserialize() that were also discovered by one of our audits in December 2004 are unrelated to the newly discovered flaw, but they have shown, that the unserialize() function is exposed to user-input in many popular PHP applications. Examples for applications that use the content of COOKIE variables with unserialize() are phpBB and Serendipity. The successful exploitation of this integer overflow will result in arbitrary code execution.
    last seen 2019-02-21
    modified 2018-11-10
    plugin id 22520
    published 2006-10-10
    reporter Tenable
    title FreeBSD : php -- _ecalloc Integer Overflow Vulnerability (e329550b-54f7-11db-a5ae-00508d6a62df)
  • NASL family CGI abuses
    NASL id PHP_5_2_0.NASL
    description According to its banner, the version of PHP 5.x installed on the remote host is older than 5.2. Such versions may be affected by several buffer overflows. To exploit these issues, an attacker would need the ability to upload an arbitrary PHP script on the remote server or to manipulate several variables processed by some PHP functions such as 'htmlentities().'
    last seen 2019-02-21
    modified 2018-07-24
    plugin id 31649
    published 2008-03-25
    reporter Tenable
    title PHP 5.x < 5.2 Multiple Vulnerabilities
  • NASL family CGI abuses
    NASL id PHP_4_3_0.NASL
    description The remote host is running PHP 4.3.0. There is a flaw in this version that could allow an attacker to execute arbitrary PHP code on this host.
    last seen 2019-02-21
    modified 2018-07-24
    plugin id 11237
    published 2003-02-18
    reporter Tenable
    title PHP < 4.3.1 CGI Module Force Redirect Settings Bypass Arbitrary File Access
  • NASL family Gentoo Local Security Checks
    NASL id GENTOO_GLSA-200610-14.NASL
    description The remote host is affected by the vulnerability described in GLSA-200610-14 (PHP: Integer overflow) A flaw in the PHP memory handling routines allows an unserialize() call to be executed on non-allocated memory due to a previous integer overflow. Impact : An attacker could execute arbitrary code with the rights of the web server user or the user running a vulnerable PHP script. Workaround : There is no known workaround at this time.
    last seen 2019-02-21
    modified 2018-07-11
    plugin id 22929
    published 2006-10-31
    reporter Tenable
    title GLSA-200610-14 : PHP: Integer overflow
  • NASL family Ubuntu Local Security Checks
    description The stripos() function did not check for invalidly long or empty haystack strings. In an application that uses this function on arbitrary untrusted data this could be exploited to crash the PHP interpreter. (CVE-2006-4485) An integer overflow was discovered in the PHP memory allocation handling. On 64-bit platforms, the 'memory_limit' setting was not enforced correctly. A remote attacker could exploit this to cause a Denial of Service attack through memory exhaustion. (CVE-2006-4486) Maksymilian Arciemowicz discovered that security relevant configuration options like open_basedir and safe_mode (which can be configured in Apache's httpd.conf) could be bypassed and reset to their default value in php.ini by using the ini_restore() function. (CVE-2006-4625) Stefan Esser discovered that the ecalloc() function in the Zend engine did not check for integer overflows. This particularly affected the unserialize() function. In applications which unserialize untrusted user-defined data, this could be exploited to execute arbitrary code with the application's privileges. (CVE-2006-4812). Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen 2019-02-21
    modified 2018-12-01
    plugin id 27942
    published 2007-11-10
    reporter Tenable
    title Ubuntu 5.04 / 5.10 / 6.06 LTS : php4, php5 vulnerabilities (USN-362-1)
redhat via4
  • rhsa
    id RHSA-2006:0688
  • rhsa
    id RHSA-2006:0708
refmap via4
bid 20349
bugtraq 20061009 Advisory 09/2006: PHP unserialize() Array Creation Integer Overflow
gentoo GLSA-200610-14
openpkg OpenPKG-SA-2006.023
sectrack 1016984
  • 22280
  • 22281
  • 22300
  • 22331
  • 22338
  • 22533
  • 22538
  • 22650
sreason 1691
suse SUSE-SA:2006:059
trustix 2006-0055
ubuntu USN-362-1
vupen ADV-2006-3922
xf php-ecalloc-integer-overflow(29362)
statements via4
contributor Mark J Cox
lastmodified 2008-06-26
organization Red Hat
statement Red Hat Enterprise Linux 5 is not vulnerable to this issue as it contains a backported patch. This issue did not affect the versions of php as shipped with Red Hat Enterprise Linux 3, and 4.
Last major update 07-03-2011 - 21:42
Published 10-10-2006 - 00:06
Last modified 30-10-2018 - 12:25
Back to Top