Starting in the 1.3.1 release, Gallery includes code to simulate the behaviour
of the PHP 'register_globals' variable in environments where that setting
is disabled. It is simulated by extracting the values of the various
$HTTP_ global variables into the global namespace.

Impact

A crafted URL such as
http://example.com/gallery/init.php?HTTP_POST_VARS=xxx causes the
'register_globals' simulation code to overwrite the $HTTP_POST_VARS which,
when it is extracted, will deliver the given payload. If the
payload compromises $GALLERY_BASEDIR then the malicious user can perform a
PHP injection exploit and gain remote access to the webserver with PHP
user UID access rights.