发新话题
打印

[转载]phpBB 2.0.15 PHP代码注入漏洞

[转载]phpBB 2.0.15 PHP代码注入漏洞

文章作者:Ron van Daal

Background:

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.

Description:

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
phpBB 2.0.11.

Technical:

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:

<?
$string1="phpinfo()";
$string2=preg_replace(&#39;//e&#39;,$string1,&#39;&#39;);
?>

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.

Solution:

Upgrade to phpBB version 2.0.16 or edit viewtopic.php on line #1110:

Change this: str_replace(&#39;\\&#39;, &#39;\\\\&#39;, $highlight_match)

Into this: str_replace(&#39;\\&#39;, &#39;\\\\&#39;, addslashes($highlight_match))

Credits:

Synto(nix) && Doqnach @Umbranet #unixtalk

<EOF>
曾几何时,有人对我说:装B遭雷劈。我说:去你妈的。于是,这个人又对我说:如果再说脏话,上帝会惩罚你的。我说:我操上帝。结论:彪悍的人生不需要上帝。

TOP

可以帮我看一个网站吗
我的QQ:547919875

TOP

发新话题