BBpress XSS vulnerability

I was wrong about BBpress not having a single vulnerability during May 2006 - May 2007. Now it has one.
As Ory Segal pointed out in his comment on the forum vulnerabilities post , the BBpress authentication page (bb-login.php) is home of a XSS vulnerability. A few days ago we’ve had an interesting conversation on this topic and I’ll post here the conclusions
Ory Segal:
It’s rather simple, and seems to be working on the installation I have here in front of me:
GET /bb-login.php?re="><script>alert(1);</script> HTTP/1.0
Host: www.some.site
Referer: http://www.some.site/
The tricky part here is that the Referer header needs to point to http://www.some.site/ - or any other path which belongs to the host on which BBPress is installed on.
If there Referer is anything but this, it’ll disregard ths value of the "re" parameter - this can be seen in the code at:
if ( 0 !== strpos($re, bb_get_option( ‘uri’ )) )
$re = $ref . $re;
Now, one might argue if this is exploitable, since you can’t fully control the HTTP Referer header, but there are several ways around this:
1) You locate a script on BBPress which forces a redirection, and then use it as the launch pad for the attack - I haven’t validated if such a script exists
2) You use some other technique, which allows you to control the HTTP Referer header, for example: http://www.cgisecurity.com/lib/XmlHTTPRequest.shtml , or http://www.webappsec.org/lists/websecurity/archive/2006-07/msg00069.html
Indeed, the refferal parameter ($re) is not sanitized properly and it’s used to render the page template:
bb_load_template( ‘login.php’, array(’re’, ‘user_exists’, ‘user_login’, ‘redirect_to’, ‘ref’) );
The login.php template simply returns the value of $re as a hidden value :
<td><input name="re" type="hidden" value="<?php echo $re; ?>" />
So basically Ory was right
and I have updated the Top 10 Open Source Forums - 12 Months of Vulnerabilities post
P.S: Read more about memory cards
If you enjoyed this post, make sure you subscribe to my RSS feed!
Thank you for reading this post. You can now Read Comments (5) or Leave A Trackback.
Post Info
This entry was posted on Thursday, June 7th, 2007 and is filed under Vulnerabilities, Web Applications.You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.
Previous Post: Up To Date Security Tools Watchlist »
Next Post: New European ICT Security Standards Roadmap »
Read More
Related Reading:- Free alternative to ArcSight ESM ? Hardly..
- Privacy Dilemma: How to Protect Yourself Online
- Solera Networks Deep-Packet Capture Review
- WordPress Exploit Scanner
- Phishing Exposed, Brands Secured
- Scanners: New Nessus Release; New eEye Web Scanner
- Good News from ArcSight and Imperva
- CCTV Security Camera and Surveillance Equipment
- OpenDNS Offers Free Web Content Filtering
- Can I Evade ScanSafe Anywhere+ ?


June 7th, 2007 04:06
[…] : BBpress XSS Vulnerability Beehive : […]
June 10th, 2007 04:58
http://blog.watchfire.com/wfblog/2007/06/a_few_blurbs.html
June 11th, 2007 04:03
Still, the fact that they are doing referer checking somewhat mitigates the attack. Sure, there’s a couple of hacks around it, but generally speaking it makes actually implementing this attack in the wild much more difficult than it would have otherwise. Defense in depth, right?
June 11th, 2007 06:03
@Jordan
Yes, the referral check was the big show stopper for a 0 day announcement
However, validating the $re variable takes only one line of code just like it’s done with the user login :
$user_login = user_sanitize ( @$_POST[’user_login’] );
June 20th, 2007 18:52
This has been fixed in version 0.8.2.1 of bbPress.
Back to zero vulnerabilities.