Heap-based buffer overflow in PHP - CVE-2008-5557

 

Heap-based buffer overflow in PHP - CVE-2008-5557

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


Vulnerability identifier: #VU110332
CSH Severity: High
CVSS v4: []
CVE-ID: CVE-2008-5557
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 in Heap-based buffer overflow in ext/mbstring/libmbfl/filters/mbfilter_htmlent.c in the mbstring extension in PHP 4.3.0 through 5.2.6. A remote attacker can use a crafted string containing an HTML entity to 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
php5-cli (Ubuntu package)
php5-gd (Ubuntu package)
php5-cgi (Ubuntu package)
libapache2-mod-php5 (Ubuntu package)
libapache2-mod-php5filter (Ubuntu package)

How to mitigate CVE-2008-5557

Install update from vendor's website.

PHP - update to 5.2.7
php5-cli (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.13, 5.2.3-1ubuntu6.5, 5.2.4-2ubuntu5.5, 5.2.6-2ubuntu4.1
php5-gd (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.13, 5.2.3-1ubuntu6.5, 5.2.4-2ubuntu5.5, 5.2.6-2ubuntu4.1
php5-cgi (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.13, 5.2.3-1ubuntu6.5, 5.2.4-2ubuntu5.5, 5.2.6-2ubuntu4.1
libapache2-mod-php5 (Ubuntu package) - addressed in versions 5.1.2-1ubuntu3.13, 5.2.3-1ubuntu6.5, 5.2.4-2ubuntu5.5, 5.2.6-2ubuntu4.1
libapache2-mod-php5filter (Ubuntu package) - update to 5.2.6-2ubuntu4.1

External References

Related Security Bulletins