Heap-based buffer overflow in PHP - CVE-2008-2371
Published: August 1, 2022 / Updated: June 8, 2025
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 pcre_compile.c in the Perl-Compatible Regular Expression (PCRE) library 7.7. A remote attacker can use a regular expression that begins with an option and contains multiple branches. 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
Gentoo Linux
Debian Linux
Ubuntu
php5-cli (Ubuntu package)
php5-cgi (Ubuntu package)
php5-curl (Ubuntu package)
libapache2-mod-php5 (Ubuntu package)
libpcre3 (Ubuntu package)
pcre3 (Debian package)
erlang-base (Ubuntu package)
dev-libs/glib
dev-libs/libpcre
How to mitigate CVE-2008-2371
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
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
libpcre3 (Ubuntu package) - addressed in versions 7.4-0ubuntu0.6.06.3, 7.4-0ubuntu0.7.04.3, 7.4-0ubuntu0.7.10.3, 7.4-1ubuntu2.1
pcre3 (Debian package) - update to 6.7+7.4-4
erlang-base (Ubuntu package) - update to 1:13.b.1-dfsg-2ubuntu1.1
dev-libs/glib - update to 2.16.3-r1
dev-libs/libpcre - update to 7.7-r1
External References
- http://bugs.gentoo.org/show_bug.cgi?id=228091
- http://www.debian.org/security/2008/dsa-1602
- http://lists.opensuse.org/opensuse-security-announce/2008-07/msg00001.html
- http://secunia.com/advisories/30916
- http://secunia.com/advisories/30944
- http://secunia.com/advisories/30958
- http://secunia.com/advisories/30961
- http://www.ubuntu.com/usn/usn-624-1
- http://secunia.com/advisories/30967
- http://www.mandriva.com/security/advisories?name=MDVSA-2008:147
- https://www.redhat.com/archives/fedora-package-announce/2008-July/msg00123.html
- http://www.gentoo.org/security/en/glsa/glsa-200807-03.xml
- http://ftp.gnome.org/pub/GNOME/sources/glib/2.16/glib-2.16.4.changes
- http://secunia.com/advisories/31200
- http://www.ubuntu.com/usn/usn-628-1
- http://secunia.com/advisories/30972
- http://www.securityfocus.com/bid/30087
- http://secunia.com/advisories/30990
- https://www.redhat.com/archives/fedora-package-announce/2008-July/msg00105.html
- http://secunia.com/advisories/30945
- http://lists.apple.com/archives/security-announce/2008/Oct/msg00001.html
- http://www.securityfocus.com/bid/31681
- http://secunia.com/advisories/32222
- http://support.apple.com/kb/HT3216
- http://secunia.com/advisories/32454
- http://wiki.rpath.com/wiki/Advisories:rPSA-2008-0305
- http://www.mandriva.com/security/advisories?name=MDVSA-2009:023
- http://www.vupen.com/english/advisories/2008/2336
- http://support.apple.com/kb/HT3549
- http://www.vupen.com/english/advisories/2009/1297
- http://www.us-cert.gov/cas/techalerts/TA09-133A.html
- http://lists.apple.com/archives/security-announce/2009/May/msg00002.html
- http://secunia.com/advisories/35074
- http://secunia.com/advisories/35650
- http://marc.info/?l=bugtraq&m=124654546101607&w=2
- http://marc.info/?l=bugtraq&m=125631037611762&w=2
- http://ubuntu.com/usn/usn-624-2
- http://www.vupen.com/english/advisories/2010/0833
- http://secunia.com/advisories/39300
- http://www.vupen.com/english/advisories/2008/2005
- http://www.vupen.com/english/advisories/2008/2006
- http://www.vupen.com/english/advisories/2008/2780
- http://secunia.com/advisories/32746
- http://security.gentoo.org/glsa/glsa-200811-05.xml
- http://www.securityfocus.com/archive/1/497828/100/0/threaded