Description
The masort function in lib/functions.php in phpLDAPadmin 1.2.x before 1.2.2 allows remote attackers to execute arbitrary PHP code via the orderby parameter (aka sortby variable) in a query_engine action to cmd.php, as exploited in the wild in October 2011.
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 14 | phpldapadmin | 1.2.0.5-2.1 | — |
| Debian 13 | phpldapadmin | 1.2.0.5-2.1 | — |
| Debian 12 | phpldapadmin | 1.2.0.5-2.1 | — |
| Debian 6.0 | phpldapadmin | 1.2.0.5-2+squeeze1 | DSA-2333-1 |
| Debian 5.0 | phpldapadmin | 1.1.0.5-6+lenny2 | DSA-2333-1 |
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.
Metasploit 1 module
-
phpLDAPadmin query_engine Remote PHP Code Injection
exploit/multi/http/phpldapadmin_query_engine
Exploit-DB 2
- phpLDAPadmin 1.2.1.1 - Remote PHP Code Injection (Metasploit) (2) EDB-18031 · webapps · Oct 25, 2011 · verified
- phpLDAPadmin 1.2.1.1 - Remote PHP Code Injection (1) EDB-18021 · webapps · Oct 23, 2011 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 1
- DSA-2333-1 phpldapadmin - several issues Debian Security (DSA / DLA) · Mar 9, 2026
References
- http://sourceforge.net/tracker/index.php?func=detail&aid=3417184&group_id=61828&atid=498546
- 76594 vdb-entry
- 50331 vdb-entry
- [oss-security] 20111025 Re: CVE request: phpldapadmin <= 1.2.1.1 XSS and and code injection flaws mailing-list
- 18021 exploit
- http://phpldapadmin.git.sourceforge.net/git/gitweb.cgi?p=phpldapadmin/phpldapadmin%3Ba=blobdiff%3Bf=lib/functions.php%3Bh=eb160dc9f7d74e563131e21d4c85d7849a0c6638%3Bhp=19fde9974d4e5eb3bfac04bb223ccbefdb98f9a0%3Bhb=76e6dad13ef77c5448b8dfed1a61e4acc7241165%3Bhpb=5d4245f93ae6f065e7535f268e3cd87a23b07744
- http://dev.metasploit.com/redmine/issues/5820
- 46672 third-party-advisory
- 46551 third-party-advisory
- [oss-security] 20111024 CVE request: phpldapadmin <= 1.2.1.1 XSS and and code injection flaws mailing-list
- http://phpldapadmin.sourceforge.net/wiki/index.php/Main_Page
- DSA-2333 vendor-advisory