Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: yan.uniko.102 on January 07, 2013, 08:08:28 AM

Title: full Disclusore in SimpleMachines Forum <= 2.0.3
Post by: yan.uniko.102 on January 07, 2013, 08:08:28 AM
*Summary:*
--------------
A security flaw allows an attacker to know the full path of the web system.

*Details:
-----------
SSI.php Line 294:
// Fetch a post with a particular ID. By default will only show if you have
permission to the see the board in question - this can be overriden.
function ssi_fetchPosts($post_ids, $override_permissions = false,
$output_method = 'echo')
{

$post_id is not defined. Possible fix: ($post_id = '')


*PoC:
-------
http://example.com/forumpath/SSI.php?ssi_function=fetchPosts

*Google Dorks:
---------------------
inurl:?index.php?action=help

*Demos:
-----------
http://simpleportal.net/SSI.php?ssi_function=fetchPosts
http://www.furgovw.org/SSI.php?ssi_function=fetchPosts
http://www.teachmideast.com/forum_old/SSI.php?ssi_function=fetchPosts
http://www.slowracing.com/jaxfox/SSI.php?ssi_function=fetchPosts
http://www.iptv2you.com/board/SSI.php?ssi_function=fetchPosts
http://voceteopr.com/SSI.php?ssi_function=fetchPosts
http://www.thesilverball.com/SSI.php?ssi_function=fetchPosts
http://othforums.com/SSI.php?ssi_function=fetchPosts
http://www.skinmod.eu/SSI.php?ssi_function=fetchPosts


Temporal Solution:
---------------------

SSI.php line 45:
$ssi_error_reporting = error_reporting(defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL);

Replace:
$ssi_error_reporting = error_reporting(0);


Functions afected:
-----------------------

. fetchMember
. fetchPosts
. fetchGroupMembers
. queryMembers

Source:
--------
http://whk.drawcoders.net/index.php/topic,2792.0.html

Mirrors:
-------------------------
http://seclists.org/fulldisclosure/2013/Jan/14
http://packetstormsecurity.com/files/119240/smf-disclose.txt
http://cxsecurity.com/issue/WLB-2013010025
https://foro.elhacker.net/nivel_web/path_disclusore_en_simplemachines_forum_203-t379876.0.html
Title: Re: Path Disclusore in SimpleMachines Forum <= 2.0.3
Post by: Arantor on January 07, 2013, 09:13:33 AM
It's not just fetchPosts that will cause this, actually. fetchMember, fetchGroupMembers, queryMembers are all vulnerable to this same bug.

If it wasn't for the fact that voting via SSI requires the query-via-HTTP function, I'd suggest disabling that entirely.
Title: Re: full Disclusore in SimpleMachines Forum <= 2.0.3
Post by: vbgamer45 on January 07, 2013, 10:11:53 AM
Confirmed the second one allows reading any file. Seems to only return the first part of the file seems to be a limit of how much data it will take form the file. 20 lines but you can read other parts of the file using the line number if passed.
Title: Re: full Disclusore in SimpleMachines Forum <= 2.0.3
Post by: yan.uniko.102 on January 07, 2013, 10:20:29 AM
Yes...

http://test.con/forum/index.php?action=...&line=37

to read MySQL Password of SimpleMachines.
Title: Re: full Disclusore in SimpleMachines Forum <= 2.0.3
Post by: Nolt on January 10, 2013, 05:05:50 PM
Hello,

I just checked and is strange, but on one server I couldn't read paths, but on other server where I have few SMF boards they was affected to this.
It could be possible that this hack depends from server configuration? (php.ini, my.ini etc.)
Title: Re: full Disclusore in SimpleMachines Forum <= 2.0.3
Post by: Arantor on January 10, 2013, 05:08:35 PM
Think you'll find a lot of this depends on having admin rights.

Not that there isn't an issue - because there is - but since it's not just open to everyone and everything, it's not the issue it might be.
Title: Re: full Disclusore in SimpleMachines Forum <= 2.0.3
Post by: HauntIT on January 16, 2013, 02:35:05 AM
Quote from: Nolt on January 10, 2013, 05:05:50 PM
Hello,

I just checked and is strange, but on one server I couldn't read paths, but on other server where I have few SMF boards they was affected to this.
It could be possible that this hack depends from server configuration? (php.ini, my.ini etc.)

Hi SMF Forum ;)

This is my first post here, anyway:
Nolt: yes, this could depends of php.ini settings. Check if you have enable parameters like: register_globals, display_errors, and html_errors, etc and disable them. Then your errors should not be presented anymore. ('For debug' you can set +w to some file at your server and then send your logs there, but be carefull here too, because somewhere in your webapp-code could be LFI bug, and there you will be owned. ;) )

Best regards,
Jakub
Title: Re: full Disclusore in SimpleMachines Forum <= 2.0.3
Post by: emanuele on February 01, 2013, 06:20:24 PM
Fixed in 2.0.4