Unrestricted Logging Filename Lead to RCE in lirantal/daloradius
Reported on
Jan 3rd 2023
Description
This vulnerability occur because there is no filename restriction for saving logging file. In this case attacker can set the filename to existing php file and append php code on it by manipulating the logged input.
Proof of Concept
- Log in using operator account, in this case i try to login using
operator1
user which is account that i created with ACL Settings onlyrep_online
enabled - Go to config and click on logging settings. Modify filename to any php file that accessible , e.g update.php then enabled
Logging of Queries
Here i use update.php - Go to rep_online feature and fill the
username
with php code, e.gphpinfo()
- Go to update.php and you will see that
phpinfo()
successfully injected
Impact
Attacker can gain RCE on server and then takeover the server (read, modify, add, and delete file)