PhpWebGallery comments.php sort_by Parameter SQL Injection

high Nessus Plugin ID 34419

Synopsis

The remote web server contains a PHP script that is susceptible to a SQL injection attack.

Description

The remote host is running PhpWebGallery, an open source photo gallery application written in PHP.

The installed version of PhpWebGallery fails to sanitize user-supplied input to the 'sort_by' parameter of the 'comments.php' script before using it in a database query. Regardless of PHP's 'magic_quotes_gpc' setting, an unauthenticated, remote attacker can leverage this issue to manipulate SQL queries and uncover sensitive information from the application's database.

Note that this issue reportedly can be leveraged to obtain an admin session and in turn gain administrative access to the application and possibly execute arbitrary code through the affected web server, although Nessus has not tested for this explicitly.

Solution

Upgrade to PhpWebGallery 1.7.3 or later.

See Also

http://www.nessus.org/u?3a1a1fac

Plugin Details

Severity: High

ID: 34419

File Name: phpwebgallery_sort_by_sql_injection.nasl

Version: 1.19

Type: remote

Family: CGI abuses

Published: 10/15/2008

Updated: 4/11/2022

Configuration: Enable thorough checks

Supported Sensors: Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 6.7

CVSS v2

Risk Factor: High

Base Score: 7.5

Temporal Score: 6.5

Vector: CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P

Vulnerability Information

CPE: cpe:/a:phpwebgallery:phpwebgallery

Required KB Items: www/PHP

Excluded KB Items: Settings/disable_cgi_scanning

Exploit Ease: No exploit is required

Reference Information

CVE: CVE-2008-4645

BID: 31762

CWE: 94