+ Reply to Thread
Results 1 to 8 of 8

Thread: Recent Filelist.ro exploit

  1. #1
    Advanced User Mihai's Avatar
    Join Date
    05.03.09
    Location
    If i tell you i must kill you
    P2P Client
    WaffleCheat v1.95 build 19928
    Posts
    1,509
    Activity Longevity
    0/20 18/20
    Today Posts
    0/5 sssss1509

    Recent Filelist.ro exploit

    This post is a technical description of the security issue that allowed a joker to escalate his rank to SysOp and send spam email from our tracker earlier this week. The hole is present in tbdev based sites and does not seem to be patched in the latest available tbdev.net source (2009 Final release 2010-02-27).

    The main problem (privilege escalation) is in the modtask.php file, that receives the form submit whenever an user profile is changed, and which allows any staffer (Mod+) to update the class of any user to an arbitrary value, for example a moderator can create SysOps by simply POSTing such a request.
    Read the rest here

    Or if you don't have an account here:
    Spoiler 1:
    To fix the main problem search for:

    modtask.php wrote:

    // Set class

    if ((isset($_POST['class'])) && (($class = $_POST['class']) != $user['class']))
    {
    if (($CURUSER['class'] < UC_SYSOP) && ($user['class'] >= $CURUSER['class'])) die ();



    or:
    modtask.php wrote:

    // Set class

    if ((isset($_POST['class'])) && (($class = $_POST['class']) != $user['class']))
    {
    if (($CURUSER['class'] < UC_SYSOP) && ($user['class'] >= $CURUSER['class'])) stderr("{$lang['modtask_user_error']}", "{$lang['modtask_try_again']}" );



    and replace the red line with:
    modtask.php wrote:

    // can't make sysops, can't promote user to your rank or higher, can't edit users at your rank or higher
    if ($class >= UC_SYSOP || ($class >= $CURUSER['class']) || ($user['class'] >= $CURUSER['class'])) die();



    The secondary problem is that even after this check, valid actions are still vulnerable to CSRF issues, for example someone might trick an a Admin to click a link and unknowingly promote him to Moderator - this is how our attacker exploited the privilege escalation issue without being a staffer. Since it's legal for Admins to create Mods, the check above is not sufficient, and we must make sure they create them knowingly.
    To mitigate CSRF holes there are many available solutions, ex. captchas, referrer checking, session tokens etc. Bellow is our solution that we believe is portable, non-intrusive and makes minimal assumptions about the run-time environment.

    Add the red lines to your userdetails.php:
    userdetails.php wrote:

    begin_frame("Edit User", true);
    print("<form method=post action=modtask.php>\n" );
    require "validator.php";
    print(validatorForm("ModTask_$user[id]" ));



    Add the red lines to your modtask.php:
    modtask.php wrote:

    // and verify...
    if (!is_valid_id($userid)) stderr("Error", "Bad user ID." );

    // Handle CSRF (modtask posts form other domains, especially to update class)
    require "validator.php";
    if (!validate($_POST[validator], "ModTask_$userid" )) die ("Invalid" );



    validator.php wrote:

    <?
    function validator($context){
    global $CURUSER;
    $timestamp=time();
    $hash=hash_hmac("sha1", $CURUSER[secret], $context.$timestamp);
    return substr($hash, 0, 20).dechex($timestamp);
    }
    function validatorForm($context){
    return "<input type=\"hidden\" name=\"validator\" value=\"".validator($context)."\"/>";
    }

    function validate($validator, $context, $seconds=0){
    global $CURUSER;
    $timestamp=hexdec(substr($validator, 20));
    if($seconds && time() > $timestamp + $seconds)
    return False;
    $hash=substr(hash_hmac("sha1", $CURUSER[secret], $context.$timestamp), 0, 20);
    if (substr($validator, 0, 20) != $hash)
    return False;
    return True;
    }
    ?>


    Really big shit if you ask me.And even a bigger problem for them is that it's on every tbdev tracker.
    What does a scene tracker tell to a general tracker?
    You're so 5 minutes ago...



    Reply With QuoteReply With Quote
    Thanks

  2. Who Said Thanks:

    slikrapid (15.07.10) , C3PO (15.07.10) , cheatos (15.07.10) , saebrtooth (15.07.10) , mangathala2002 (15.07.10) , anon (15.07.10)

  3. #2
    Moderator anon's Avatar
    Join Date
    01.02.08
    Posts
    39,546
    Activity Longevity
    11/20 19/20
    Today Posts
    1/5 ssss39546
    Quote Originally Posted by Mihai View Post
    And even a bigger problem for them is that it's on every tbdev tracker.
    Something even bigger would be users covertly promoting themselves to admins and taking advantage of that. Thanks to this idiot, now they know about the bug and how to fix it.
    "I just remembered something that happened a long time ago."
    Reply With QuoteReply With Quote
    Thanks

  4. #3
    Advanced User Mihai's Avatar
    Join Date
    05.03.09
    Location
    If i tell you i must kill you
    P2P Client
    WaffleCheat v1.95 build 19928
    Posts
    1,509
    Activity Longevity
    0/20 18/20
    Today Posts
    0/5 sssss1509
    That idiot is GOD , the big BOSS at Filelist.ro
    What does a scene tracker tell to a general tracker?
    You're so 5 minutes ago...



    Reply With QuoteReply With Quote
    Thanks

  5. #4
    Moderator anon's Avatar
    Join Date
    01.02.08
    Posts
    39,546
    Activity Longevity
    11/20 19/20
    Today Posts
    1/5 ssss39546
    I was talking about this idiot:
    This post is a technical description of the security issue that allowed a joker to escalate his rank to SysOp and send spam email from our tracker earlier this week.
    "I just remembered something that happened a long time ago."
    Reply With QuoteReply With Quote
    Thanks

  6. Who Said Thanks:

    Mihai (15.07.10)

  7. #5
    Advanced User Mihai's Avatar
    Join Date
    05.03.09
    Location
    If i tell you i must kill you
    P2P Client
    WaffleCheat v1.95 build 19928
    Posts
    1,509
    Activity Longevity
    0/20 18/20
    Today Posts
    0/5 sssss1509
    Quote Originally Posted by anon View Post
    I was talking about this idiot:
    Got it now.Here's a pic with what I think is the guy who hacked the tracker:
    What does a scene tracker tell to a general tracker?
    You're so 5 minutes ago...



    Reply With QuoteReply With Quote
    Thanks

  8. #6
    I received several PM's from that dude too.
    He was promoting his new tracker.
    Reply With QuoteReply With Quote
    Thanks

  9. #7
    Advanced User Mihai's Avatar
    Join Date
    05.03.09
    Location
    If i tell you i must kill you
    P2P Client
    WaffleCheat v1.95 build 19928
    Posts
    1,509
    Activity Longevity
    0/20 18/20
    Today Posts
    0/5 sssss1509
    Strange I didn't received anything...or not counting the fact that I have more power than GOD itself:muhahahahahaha:
    What does a scene tracker tell to a general tracker?
    You're so 5 minutes ago...



    Reply With QuoteReply With Quote
    Thanks

  10. #8
    Advanced User C3PO's Avatar
    Join Date
    07.05.10
    Posts
    837
    Activity Longevity
    1/20 17/20
    Today Posts
    0/5 ssssss837
    I didn't recieve a thing, either....
    Reply With QuoteReply With Quote
    Thanks

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •