Skip to content
RCE Disclosed report Intermediate

Possible RCE

The report claims that in a PHP file, user input from a POST parameter is used as a dynamic function name, potentially allowing an attacker to call arbitrary functions. The author suggests that sending a crafted POST request could lead to remote code execution, but they did not test it.

paulos__ Follow

Originally disclosed on HackerOne

  • Disclosed after 21 months

Hello,

I just quickly took a glance, I am not entirely sure or didn't get a chance to test it but it seems there are some serious bugs.

In /apps/user_ldap/ajax/wizard.php:

PHP
36: $action = (string)$_POST['action']; 

and it is called in multiple places. including line 83 & 99. one being $action($loginName); & since $loginName is defined as:

PHP
$loginName = $_POST['ldap_test_loginname'];

would mean an RCE is achievable when $result is called

PHP
$result = $wizard->$action($loginName);

This is because userinput is used as dynamic function name. ergo, arbitrary functions may be called.

All an attacker have to send is a POST request with action parameter containing a function name like action=eval&ldap_test_loginname=stufftoexecute

There is a very little chance the $wizard will stop this because arbritary wakeup & constract objects may be exploitable. like I said, I didn't get a chance to test this but seems fairly feasible. please think about it and let me know.

Thanks, P

The original report as published on HackerOne, by paulos__. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the code takes a POST parameter and uses it directly as a function name without validating it against a list of allowed functions.

Impact

An attacker could potentially execute arbitrary code on the server, but the report notes this was not tested and may be limited by the wizard object.

What the attacker needed

Access to the vulnerable endpoint; ability to send POST requests

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 report has not been written yet. The Original tab links to the source.

In some programming languages, you can call a function by using a variable that holds its name. If that variable comes from user input, an attacker might be able to call any function they want, including dangerous ones. This report suggests that could happen here, but it was not confirmed.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by paulos__

View all

16 more disclosed reports, best first.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.