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

Punbb-1.2.8.txt

Punbb-1.2.8.txt
Posted Oct 21, 2005
Authored by DevilBox | Site KAPDA.ir

"Search.php" in Punbb versions 1.2.8 and earlier does not properly validate user-supplied input. A remote user can create specially crafted parameter values that will execute SQL commands on the underlying database. POC included.

tags | advisory, remote, php
SHA-256 | ef14a68dd3dad542f61ee592dc81bdb6aebfcf8062ee30128e663c593850becf

Punbb-1.2.8.txt

Change Mirror Download
[KAPDA::#6] Punbb SQL Injection Vulnerability

Punbb search.php SQL Injection Vulnerability

KAPDA New advisory

Vulnerable products : Punbb ( V 1.2.8 and 1.2.7 are tested,Hopefully all other versions)

Vendor: http://www.punbb.org/

Vulnerability: Sql injection

About Punbb
--------------------
PunBB is a fast and lightweight PHP-powered discussion board. It is released under the GNU

General Public License. Its primary goals are to be faster, smaller and less graphically intensive

as compared to other discussion boards. PunBB has fewer features than many other discussion

boards, but is generally faster and outputs smaller, semantically correct XHTML-compliant pages.

Vendor`s description : http://punbb.org/about.php

Discussion :
----------------
Scripts in page "Search.php" do not properly validate user-supplied input. A remote user can

create specially crafted parameter values that will execute SQL commands on the underlying

database.

While "Global_register" of php.ini is set ON ,Remote user can poison local variables

of PHP pages to take control of web application or change its logical flow.

Vulnerabilities:
--------------------
In Search.php :

.......... start ...........

if ($db->num_rows($result))
{
while ($row = $db->fetch_row($result))
$old_searches[] = '\''.$db->escape($row[0]).'\'';
$db->query('DELETE FROM '.$db->prefix.'search_cache WHERE ident NOT IN('
.implode(',', $old_searches).')') or error('Unable to delete search results'
, __FILE__, __LINE__, $db->error());
}

.......... end ...........

The 4th line of pasted code sets old_searches[] (array) to carefully validated data,

returned from database and then at next line it sends another query containing

old_searches[].

If "Global_register" of php.ini is set ON and there is no SQL injection filters ( or magic_quotes)

then poisoning old_searches can let remote users directly execute SQL commands.

Proof of Concepts:
--------------------
http://[site]/search.php?action=search&keywords=&author=d3vilbox&
forum=-1&search_in=all&sort_by=0&sort_dir=DESC&show_as=topics
&search=Submit&old_searches[]=[sql injection]


Solution:
--------------------
find :
.......... Start ...........


if ($db->num_rows($result))
{
while ($row = $db->fetch_row($result))

$old_searches[] = '\''.$db->escape($row[0]).'\'';
.......... End ...........

and add "$old_searches=array();" before beginning of "While" to clear old_searches.

it should looks like :

.......... Start ...........


$old_searches = array();


if ($db->num_rows($result))
{
while ($row = $db->fetch_row($result))

$old_searches[] = '\''.$db->escape($row[0]).'\'';
.......... End ...........

More Detail:
--------------------
http://www.kapda.ir/advisory-91.html
Visit above link for more details.

Credit :
--------------------
Devil_box of KAPDA
devil_box [at} kapda.ir
Kapda - Security Science Researchers Insitute of Iran
http://www.KAPDA.ir
(PersianHacker.NET)

Original Advisory : http://www.kapda.ir/advisory-91.html
Special thanks to : Trueend and Irannetjob
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    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