Gallery photo album package before 1.3.1 allows local and possibly remote attackers to execute arbitrary code via a modified GALLERY_BASEDIR variable that points to a directory or URL that contains a Trojan horse init.php script.
https://exchange.xforce.ibmcloud.com/vulnerabilities/9737
http://www.securityfocus.com/bid/5375