Tuesday, June 19, 2012

vBulletin 4.2.0 XSS Vulnerability

$------------------------------------------------------------------------------------------------------------
$ vBulletin 4.2.0 XSS Vulnerability
$ Author : sangteamtham
$ Home : Hcegroup.vn
$ Download: http://members.vbulletin.com/
$ Date :06/13/2012
$ Google Dork: "Powered by vBulletin® Version 4.2.0"
$ Twitter: http://twitter.com/Sangte_amtham
$*************************************************************************************************************
1.vBulletin Description:

 Content publishing, search, security, and more— vBulletin has it all.
 Whether it’s available features, support, or ease-of-use, vBulletin offers the most for your money.
 Learn more about what makes vBulletin the choice for people who are serious about creating
 thriving online communities.

2. Vulnerability Description:

To steal cookie from administrator or any member in a forum or drive them to malicious sites, attacker will firstly create an account, then come to
calendar section, and create an event for himself.

In title, he will inject XSS code there.

In content section, he will write everything he likes. Now, he will send his profile to Administrator or any member
and wait for cookie or victims' infection.

http://127.0.0.1/vbb/member.php?id-xyz

3. Patch:

June 13, 2012: Contacted the vendor.
June 14, 2012: Vendor replied me.
June 18, 2012: the vendor released the patch for this vulnerabitily. Please download it from member Area right now.

https://members.vbulletin.com/patches.php

$**************************************************************************************************************
$ Greetz to: All Vietnamese hackers and Hackers out there researching for more security
$
$
$------------------------------------------------------------------------------------------------------------

How to fix it?

Here we have vulnerable file named calendar.php in:
doc_root/vb/activitystream/view/perm/calendar/event.php

In line 74 to 77

public function fetchTemplate($templatename, $activity)
{
    $eventinfo =& $this->content['event'][$activity['contentid']];
    $calendarinfo =& $this->content['calendar'][$eventinfo['calendarid']];

Our title for events doesn't work. We need to filter it like this:

public function fetchTemplate($templatename, $activity)
{
    $eventinfo =& $this->content['event'][$activity['contentid']];
    $calendarinfo =& $this->content['calendar'][$eventinfo['calendarid']];
        $eventinfo['title'] = htmlspecialchars_uni($eventinfo['title']);

Please fix it asap.