exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

punbb125sql.txt

punbb125sql.txt
Posted Jul 8, 2005
Authored by Stefan Esser | Site hardened-php.net

An uninitialized variable within PunBB can allow for SQL injection attacks. Versions 1.2.5 and below are affected.

tags | advisory, sql injection
SHA-256 | eb81280e35ea34327585e1b7b5729bfc63d2a0f2e92532ceca5e39189c9408be

punbb125sql.txt

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hardened-PHP Project
www.hardened-php.net

-= Security Advisory =-



Advisory: PunBB SQL Injection Vulnerability
Release Date: 2005/08/05
Last Modified: 2005/08/05
Author: Stefan Esser [sesser@hardened-php.net]

Application: PunBB <= 1.2.5
Severity: An uninitialised variable within PunBB allows
SQL injection and can lead to forum privilege
escalation
Risk: Critical
Vendor Status: Vendor has released an updated version
References: http://www.hardened-php.net/advisory-082005.php


Overview:

Quote from http://www.punbb.org
"In short, PunBB is a fast and lightweight PHP powered discussion
board. It is released under the GNU Public License. Its primary goal
is to be a faster, smaller and less graphic alternative to otherwise
excellent discussion boards such as phpBB, Invision Power Board or
vBulletin. PunBB has fewer features than many other discussion
boards, but is generally faster and outputs smaller pages."

An audit of PunBB has revealed an SQL injection vulnerability in the
user profile edit module. As a result of this an attacker may inject
arbitrary field-updates into an UPDATE query, that is executed on the
user table. By simply updating the group id of a useracount it is
possible to become an admin.

Due to the fact, that this bug relies on a not initialised variable
it is only exploitable when register_globals is turned on, which is
the case on most PHP servers, that actually use forums.


Details:

During an audit of PunBB we stumbled on the following code-snippet
that can be found in the user profile edit module in profile.php.

// Singlequotes around non-empty values and NULL for ...
while (list($key, $input) = @each($form))
{
$value = ($input !== '') ?
'\''.$db->escape($input).'\'' : NULL;
$temp[] = $key.'='.$value;
}

$db->query('UPDATE '.$db->prefix.'users SET '.
implode(',', $temp)...

This piece of code converts an array of form variables into an
array of 'key=value' strings that are then used as parameters
of an update query. The values are user supplied and therefore
correctly escaped.

However this code fails to initialize the $temp variable and
so it is possible for an attacker to supply arbitrary 'key=value'
strings through the GET, POST or COOKIE variables, when
register_globals is on.

Injecting something like temp[0]=group_id=1 is enough to add
yourself to the Administrators group. As an admin it is possible
to execute arbitrary PHP code through the template system.
(see Advisory 09/2005 for details)


Proof of Concept:

The Hardened-PHP Project is not going to release an exploit
for this vulnerability to the public.


Disclosure Timeline:

27. June 2005 - Contacted security@punbb.org via email
28. July 2005 - Discussed solution possibilities with vendor
07. July 2005 - Vendor releases bugfixed version
08. July 2005 - Public disclosure


Recommendation:

We strongly recommend to upgrade to the vendor supplied
new version

PunBB 1.2.6
http://www.punbb.org/download/punbb-1.2.6.tar.gz


GPG-Key:

http://www.hardened-php.net/hardened-php-signature-key.asc

pub 1024D/0A864AA1 2004-04-17 Hardened-PHP Signature Key
Key fingerprint = 066F A6D0 E57E 9936 9082 7E52 4439 14CC 0A86 4AA1


Copyright 2005 Stefan Esser. All rights reserved.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFCzbStRDkUzAqGSqERAr+0AJ9WHhwTBscP4sMxfMk/kGH2UPsI6ACgjyec
pnwtMpG5HFGQyBormf7Ej0o=
=rE61
-----END PGP SIGNATURE-----

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
    0 Files
  • 9
    Sep 9th
    0 Files
  • 10
    Sep 10th
    0 Files
  • 11
    Sep 11th
    0 Files
  • 12
    Sep 12th
    0 Files
  • 13
    Sep 13th
    0 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 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