Lucene search
K

DIY CMS v1.0 Poll - Multiple Web Vulnerabilities

🗓️ 26 Apr 2012 00:00:00Reported by Vulnerability Laboratory [Research Team] - snup ([email protected])Type 
vulnerlab
 vulnerlab
🔗 www.vulnerability-lab.com👁 26 Views

DIY CMS v1.0 Poll - Multiple Web Vulnerabilities refers to a high-risk security issue in the DIY v1.0 Content Management System. It involves SQL injection, cross site scripting, and cross site request forgery vulnerabilities in the poll module

Code
Document Title:
===============
DIY CMS v1.0 Poll - Multiple Web Vulnerabilities


References (Source):
====================
http://www.vulnerability-lab.com/get_content.php?id=518


Release Date:
=============
2012-04-26


Vulnerability Laboratory ID (VL-ID):
====================================
518


Product & Service Introduction:
===============================
Do It Yourslef Content Management System is a feature-rich, php-built, mysql-based, opensource and free CMS. 
It is suitable to manage any kind of contents. It is modular, extensible and easliy skinnable. Build your own modules for specific 
purposes, add certain functionalites to suit your needs and design a theme that represents the content of your website. 

(Copy of the Vendor Homepage: http://diy-cms.com)


Abstract Advisory Information:
==============================
A Vulnerability Laboratory researcher discovered multiple web vulnerabilities in DIY v1.0 Content Management System.


Vulnerability Disclosure Timeline:
==================================
2012-04-16:	Public or Non-Public Disclosure


Discovery Status:
=================
Published


Exploitation Technique:
=======================
Remote


Severity Level:
===============
High


Technical Details & Description:
================================
1.1
A SQL Injection vulnerability  is detected in DIY v1.0 Content Management System.
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.

Vulnerable Module(s): 
                                           [+] Mod - Poll

1.2
Multiple non persistent cross site scripting vulnerability is detected  in DIY v1.0 Content Management System.
The vulnerability allows remote attackers to hijack website customer, moderator or admin sessions with high required 
user inter action or local low privileged user account. Successful exploitation can result in account steal, phishing 
& client-side content request manipulation.

Vulnerable Module(s): 
                                           [+] Poll - Question & Answer Input/Output


1.3
A cross site request forgery vulnerability is detected  in DIY v1.0 Content Management System. The bugs allow remote 
attackers with high required user inter action to edit user accounts. Successful exploitation can lead to account access.
To exploit the issue the attacker need to create a manipulated copy the edit user mask/form. Inside of the document the 
remote can implement his own values for the update because of no form or token protection. When admin get now forced to 
execute the script via link he is executing the new value on the update of the application if his session is not expired.

Vulnerable Module(s): 
                                           [+] &modfile=add


Proof of Concept (PoC):
=======================
1.1
The sql injection vulnerabilities can be exploited by remote attackers without user inter action.
Exploitation requires the possibility to allow an attacker to add or config a poll.
For demonstration or reproduce ...

PoC:
diy-cms/mod.php?mod=poll&start=`[SQL-INJECTION]--


1.2
The cross site vulnerabilities can be exploited by remote attackers with medium required user inter action.
For demonstration or reproduce ...

PoC:
diy-cms/modules/poll/add.php[Cross Site Scripting]


1.3
The cross site request forgery vulnerabilities can be exploited by remote attackers with high required user inter action.
For demonstration or reproduce ...

<form action="http://127.0.0.1/diy/mod.php?mod=poll&modfile=add" method="post" name="add_poll" enctype="multipart/form-data">
<input type="hidden" name='polltype' value='1'>

<input type="hidden" name="question" value="<script>alert(1)</script>">
<input type="hidden" name="answer1" value="<script>alert(1)</script>">
<input type="hidden" name="answer2" value="<script>alert(1)</script>">

<input type="hidden" name='active' value='1' checked>
<input type=submit name='submit' value=XSS></td>
</form>


Solution - Fix & Patch:
=======================
1.1

In file /diy-cms/modules/poll/index.php 
line: 50 - 55

$ppp = $mod->setting(/`polls_per_page/`);
		if(!isset($_GET[/`start/`]))
		{$start = /`0/`;
		}else{
		$start = $_GET[/`start/`];
		}

we edit to:

$ppp = $mod->setting(/`polls_per_page/`);
		if(!isset($_GET[/`start/`]))
		{$start = /`0/`;
		}else{
		$start = (int)$_GET[/`start/`];
		}



1.2

In file /diy-cms/modules/poll/add.php
line: 53 - 84

         if($submit)
        {
           extract($_POST);
           $type  = $_POST[/``polltype/``];
           $question = $_POST[/``question/``];
           $status = $_POST[/``active/``];
           $date = time();

           $arr_post_vars = array($type,  $question);
							
           if (!required_entries($arr_post_vars))
           {
               error_message($lang[/`LANG_ERROR_VALIDATE/`]);
           }

           if($status == /`1/`)
           {
              $result = $diy_db->query(/``update diy_poll_questions set status=/`0/`/``);
          }
	 
          $result = $diy_db->query(/``INSERT INTO diy_poll_questions VALUES (/`/`,/`$question/`,/`$type/`,/`$status/`,/`$date/`)/``);
          $qid = $diy_db->insertid();

we edit to:

         if($submit)
         {
         extract($_POST);
         $type  = $_POST[/``polltype/``];
         $question = $_POST[/``question/``];
         $status = $_POST[/``active/``];
         $date = time();

         $arr_post_vars = array($type, $question);
							
         if (!required_entries($arr_post_vars))
         {
             error_message($lang[/`LANG_ERROR_VALIDATE/`]);
         }

         if($status == /`1/`)
         {
             $result = $diy_db->query(/``update diy_poll_questions set status=/`0/`/``);
         }
         $question = htmlspecialchars(strip_tags($question));	 
         $result = $diy_db->query(/``INSERT INTO diy_poll_questions VALUES (/`/`,/`$question/`,/`$type/`,/`$status/`,/`$date/`)/``);
         $qid = $diy_db->insertid();

In file /diy-cms/modules/poll/edit.php
line: 69 - 76

         $result = $diy_db->query(/``update diy_poll_questions set question=/`$question/`, type=/`$type/`, status=/`$status/` where qid=/`$qid/`/``);
 
	 foreach ($_POST[/`answer/`] as $answer)
	 {
		$answer = $answer;
		if (!empty($answer)) {
		$diy_db->query(/``update diy_poll_answers set answer=/`$answer/` where aid=/`$aid/` /``);
         }

we edit to:

         $question = htmlspecialchars(strip_tags($question));	 
         $result = $diy_db->query(/``update diy_poll_questions set question=/`$question/`, type=/`$type/`, status=/`$status/` where qid=/`$qid/`/``);
 
	 foreach ($_POST[/`answer/`] as $answer)
	 {
		$answer = htmlspecialchars(strip_tags($answer));
		if (!empty($answer)) {
		$diy_db->query(/``update diy_poll_answers set answer=/`$answer/` where aid=/`$aid/` ``);
         }


Security Risk:
==============
1.1
The security risk of the sql injection vulnerabilities are estimated as high(+).

1.2
The security risk of the persistent input validation vulnerability is estimated as medium(-).

1.2
The security risk of the persistent input validation vulnerability is estimated as low(+).


Credits & Authors:
==================
Vulnerability Laboratory [Research Team]  -    snup ([email protected])


Disclaimer & Information:
=========================
The information provided in this advisory is provided as it is without any warranty. Vulnerability-Lab disclaims all warranties, 
either expressed or implied, including the warranties of merchantability and capability for a particular purpose. Vulnerability-
Lab or its suppliers are not liable in any case of damage, including direct, indirect, incidental, consequential loss of business 
profits or special damages, even if Vulnerability-Lab or its suppliers have been advised of the possibility of such damages. Some 
states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation 
may not apply. We do not approve or encourage anybody to break any vendor licenses, policies, deface websites, hack into databases 
or trade with fraud/stolen material.

Domains:    www.vulnerability-lab.com   	- www.vuln-lab.com			       - www.vulnerability-lab.com/register
Contact:    [email protected] 	- [email protected] 	       - [email protected]
Section:    video.vulnerability-lab.com 	- forum.vulnerability-lab.com 		       - news.vulnerability-lab.com
Social:	    twitter.com/#!/vuln_lab 		- facebook.com/VulnerabilityLab 	       - youtube.com/user/vulnerability0lab
Feeds:	    vulnerability-lab.com/rss/rss.php	- vulnerability-lab.com/rss/rss_upcoming.php   - vulnerability-lab.com/rss/rss_news.php

Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability Laboratory. 
Permission to electronically redistribute this alert in its unmodified form is granted. All other rights, including the use of other 
media, are reserved by Vulnerability-Lab Research Team or its suppliers. All pictures, texts, advisories, sourcecode, videos and 
other information on this website is trademark of vulnerability-lab team & the specific authors or managers. To record, list (feed), 
modify, use or edit our material contact ([email protected] or [email protected]) to get a permission.

    				   	Copyright © 2012 | Vulnerability Laboratory



Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation