Incorrect Calculation of Buffer Size in PHP - CVE-2008-0599

 

Incorrect Calculation of Buffer Size in PHP - CVE-2008-0599

Published: February 2, 2024 / Updated: June 8, 2025


Vulnerability identifier: #VU110346
CSH Severity: High
CVSS v4: 9.3 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2008-0599
CWE-ID: CWE-131
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote non-authenticated attacker to execute arbitrary code.

The init_request_info function in sapi/cgi/cgi_main.c in PHP before 5.2.6 does not properly consider operator precedence when calculating the length of PATH_TRANSLATED, which might allow remote attackers to execute arbitrary code via a crafted URI.


Affected software

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

How to mitigate CVE-2008-0599

Install update from vendor's website.

PHP - update to 5.2.6
libapache2-mod-php5 (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.12, 5.2.1-0ubuntu1.6, 5.2.3-1ubuntu6.4, 5.2.4-2ubuntu5.3
php5-cgi (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.12, 5.2.1-0ubuntu1.6, 5.2.3-1ubuntu6.4, 5.2.4-2ubuntu5.3
php5-curl (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.12, 5.2.1-0ubuntu1.6, 5.2.3-1ubuntu6.4, 5.2.4-2ubuntu5.3
php5-cli (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.12, 5.2.1-0ubuntu1.6, 5.2.3-1ubuntu6.4, 5.2.4-2ubuntu5.3

External References

Related Security Bulletins