Heap-based buffer overflow in PHP - CVE-2007-4661

 

Heap-based buffer overflow in PHP - CVE-2007-4661

Published: October 3, 2018 / Updated: June 8, 2025


Vulnerability identifier: #VU110372
CSH Severity: Medium
CVSS v4: []
CVE-ID: CVE-2007-4661
CWE-ID: CWE-122
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The vulnerability exists due to a boundary error within the chunk_split function in string.c in PHP 5.2.3 does not properly calculate the needed buffer size due to precision loss when performing integer arithmetic with floating point numbers, which. A remote attacker can trigger a heap-based buffer overflow and execute arbitrary code on the target system.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.


Affected software

PHP
Ubuntu
libapache2-mod-php5 (Ubuntu package)
php5-cli (Ubuntu package)
php5-cgi (Ubuntu package)

How to mitigate CVE-2007-4661

Install update from vendor's website.

PHP - update to 5.2.4
libapache2-mod-php5 (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.10, 5.1.6-1ubuntu2.7, 5.2.1-0ubuntu1.5, 5.2.3-1ubuntu6.1
php5-cli (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.10, 5.1.6-1ubuntu2.7, 5.2.1-0ubuntu1.5, 5.2.3-1ubuntu6.1
php5-cgi (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.10, 5.1.6-1ubuntu2.7, 5.2.1-0ubuntu1.5, 5.2.3-1ubuntu6.1

External References

Related Security Bulletins