phpLDAPadmin <= 1.2.1.1 (lib/functions.php) PHP Code Injection Vulnerability
The lib/functions.php script in phpLDAPadmin did not properly sanitise user input passed to cmd.php through the 'orderby' parameter before using it in a call to create_function(). A remote attacker could inject and execute arbitrary PHP code.
karmainsecurity.com
Published on karmainsecurity.com
phpLDAPadmin contains a flaw related to the lib/functions.php script which fails to properly sanitize user-supplied input passed to the cmd.php script via the ‘orderby’ parameter before use it in a call to the createfunction() PHP function. This allows a remote attacker to inject and execute arbitrary PHP code.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely user-controlled input from the 'orderby' parameter was concatenated into code passed to create_function() without sanitisation, so the input became executable PHP.
Impact
A remote attacker could inject and execute arbitrary PHP code on the server.
What the attacker needed
Network access to the phpLDAPadmin instance
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Some older PHP code could build a new function on the fly from a piece of text, and that text came partly from the user. Because the text was not cleaned, an attacker could slip in their own PHP instructions and the server would run them. That means the attacker could do anything the web server is allowed to do.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.