Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
Security Advisory - phpBB 2.0.15 PHP-code injection bug
From: ronvdaal (ronvdaalzarathustra.linux666.com)
Date: Tue Jun 28 2005 - 16:03:22 CDT
Security Advisory -//- phpBB 2.0.15 PHP-code injection bug
Program: phpBB 2.0.15 and older versions
Risk: Very High
Date: June 28 2005
Title: PHP-code injection bug
Type: partial disclosure
Author: Ron van Daal :.
Vendor notified: June 23 2005
phpBB is a high powered, fully scalable, and highly customizable
Open Source bulletin board package. Based on the PHP server language
and supporting a variety of backend database servers.
Due to a bug in the phpBB highlighting code it's possible to inject
PHP-code into the running script. E.g. It's possible to run system
commands if the PHP interpreter allows system() and simular functions.
This is actually based on an old bug which was improperly fixed in
The highlighting code uses the preg_replace() function on line 1110
in viewtopic.php. It uses the special modifier "e" which causes PHP
to evaluate the replacement string as PHP code. Below is a PHP code
example of what actually happens:
This causes PHP to execute the phpinfo() function. Usage of the
preg_replace special modifier "e" should be avoided if possible.
Proof of concept:
Sorry, partial disclosure advisory.
Upgrade to phpBB version 2.0.16 or edit viewtopic.php on line #1110:
Change this: str_replace('\\', '\\\\', $highlight_match)
Into this: str_replace('\\', '\\\\', addslashes($highlight_match))
Synto(nix) && Doqnach Umbranet #unixtalk
Theo de Raadt: "BSD guys are a lot like Linux guys, except they have kissed girls"
Methinks: "FreeBSD guys are a lot like OpenBSD guys, except they have fscked girls"