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

phpBBsqlAll.txt

phpBBsqlAll.txt
Posted Jun 23, 2005
Authored by James Bercegay | Site gulftech.org

phpBB suffers from SQL injection vulnerabilities.

tags | advisory, vulnerability, sql injection
SHA-256 | ca458f33b9f3016fe72402ab33dfbbd57fcb02856066cf26233223b8394b26ef

phpBBsqlAll.txt

Change Mirror Download
##########################################################
# GulfTech Security Research April 27th, 2005
##########################################################
# Vendor : Oxpus
# URL : http://www.oxpus.de/
# Version : All Versions
# Risk : SQL Injection Vulnerability
##########################################################

Description:
oxpus.de author many popular modules and hacks for the amazingly
popular phpBB software. One of these modules allows users to keep
their own personal memo pad of sorts in the usercp. This particular
mod comes standard with packages like orion_phpbb and others. This
"notes" module is vulnerable to a serious SQL Injection vulnerability
that will allow for an attacker to pull sensitive information from
the underlying database, and possibly compromise the integrity of
the affected phpBB installation.



SQL Injection:
There is a high risk SQL Injection issue in the phpBB notes module
that allows for malicious users to pull sensitive data from the
underlying database and possibly compromise the affected phpBB
installation. Let's have a look at part of the vulnerable code.

if ( $mode == 'editpost' )
{
$sql = "SELECT * FROM " . NOTES_TABLE . "
WHERE post_id = ".$post_id."
AND poster_id = " . $userdata['user_id'] . " ";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't query notes table", '',
__LINE__, __FILE__, $sql);
}
else
{
while( $row = $db->sql_fetchrow($result) )
{
$subject = $row['post_subject'];
$bbcode_on = $row['bbcode'];
$smilies_on = $row['smilies'];
$acronym_on = $row['acronym'];
$uid = $row['bbcode_uid'];
$message = $row['post_text'];
if ( $row['bbcode_uid'] != '' )
{
$message = preg_replace('/\:(([a-z0-9]:)?)' . $uid .
'/s', '', $message);
}
}
}
$page_title = $lang['Edit_Post'];
}

As we can see from this code $post_id is not encapsulated in single quotes.
This is appropriate as the expected data type is an integer, but the
incoming data is never checked for arbitrary content. The below example
can be used to pull a username from the database, but could just as easily
be something less "benign".

http://localhost/posting_notes.php?mode=editpost&p=-99%20UNION%20SELECT%200,0,username,0,0,0,0,0,0%20FROM%20orionphpbb_users%20WHERE%20user_id=2/*

It should also be noted that other functions in the posting_notes.php
file are vulnerable as well (i.e.: the delete function). On a side note
I would like to send a reminder to ALL webmasters. Whenever you download a
third party module from a website there is usually no guarantee or assurance
that the code is safe. It is up to you to either have a professional view
the code for you, or view it yourself at least before putting it in a place
where the general public has access to it.



Solution:
I found this issue in Orion PhpBB, and contacted Sonny from cback.de. He
was very helpful and prompt in his response, and has created a mod to
help prevent these types of issues. The CrackerTracker mod is found here.

http://community.cback.de/printview.php?t=1724

I believe the new versions of orion phpBB have the fixed files, and if not
oxpus.de should have a fix out soon as Sonny has contacted them :)



Related Info:
The original advisory can be found at the following location
http://www.gulftech.org/?node=research&article_id=00070-04272005



Credits:
James Bercegay of the GulfTech Security Research Team
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
    48 Files
  • 20
    Sep 20th
    36 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