Description
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.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 3.0 | gallery | 1.2.5-7 | DSA-138 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Exploit-DB 1
- Bharat Mediratta Gallery 1.x - Remote File Inclusion EDB-21676 · webapps · Aug 1, 2002 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 1
- DSA-138 gallery - remote exploit Debian Security (DSA / DLA) · Mar 9, 2026
References
- DSA-138 vendor-advisory
- 20020801 code injection in gallery mailing-list
- 5375 vdb-entry
- http://gallery.menalto.com/modules.php?op=modload&name=News&file=article&sid=50&mode=thread&order=0&thold=0
- gallery-basedir-execute-commands(9737) vdb-entry