1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
Title: ====== DIY CMS v1.0 Poll - Multiple Web Vulnerabilities Date: ===== 2012-04-26 References: =========== http://www.vulnerability-lab.com/get_content.php?id=518 VL-ID: ===== 518 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: ========= A Vulnerability Laboratory researcher discovered multiple web vulnerabilities in DIY v1.0 Content Management System. Report-Timeline: ================ 2012-04-16: Public or Non-Public Disclosure Status: ======== Published Exploitation-Technique: ======================= Remote Severity: ========= High Details: ======== 1.1 A SQL Injection vulnerabilityis 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 detectedin 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 detectedin 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: ================= 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=<code>[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: ========= 1.1 In file /diy-cms/modules/poll/index.php line: 50 - 55 $ppp = $mod->setting(/</code>polls_per_page/<code>); if(!isset($_GET[/</code>start/<code>])) {$start = /</code>0/<code>; }else{ $start = $_GET[/</code>start/<code>]; } we edit to: $ppp = $mod->setting(/</code>polls_per_page/<code>); if(!isset($_GET[/</code>start/<code>])) {$start = /</code>0/<code>; }else{ $start = (int)$_GET[/</code>start/<code>]; } 1.2 In file /diy-cms/modules/poll/add.php line: 53 - 84 if($submit) { extract($_POST); $type= $_POST[/</code><code>polltype/</code><code>]; $question = $_POST[/</code><code>question/</code><code>]; $status = $_POST[/</code><code>active/</code><code>]; $date = time(); $arr_post_vars = array($type,$question); if (!required_entries($arr_post_vars)) { error_message($lang[/</code>LANG_ERROR_VALIDATE/<code>]); } if($status == /</code>1/<code>) { $result = $diy_db->query(/</code><code>update diy_poll_questions set status=/</code>0/<code>/</code><code>); } $result = $diy_db->query(/</code><code>INSERT INTO diy_poll_questions VALUES (/</code>/<code>,/</code>$question/<code>,/</code>$type/<code>,/</code>$status/<code>,/</code>$date/<code>)/</code><code>); $qid = $diy_db->insertid(); we edit to: if($submit) { extract($_POST); $type= $_POST[/</code><code>polltype/</code><code>]; $question = $_POST[/</code><code>question/</code><code>]; $status = $_POST[/</code><code>active/</code><code>]; $date = time(); $arr_post_vars = array($type, $question); if (!required_entries($arr_post_vars)) { error_message($lang[/</code>LANG_ERROR_VALIDATE/<code>]); } if($status == /</code>1/<code>) { $result = $diy_db->query(/</code><code>update diy_poll_questions set status=/</code>0/<code>/</code><code>); } $question = htmlspecialchars(strip_tags($question)); $result = $diy_db->query(/</code><code>INSERT INTO diy_poll_questions VALUES (/</code>/<code>,/</code>$question/<code>,/</code>$type/<code>,/</code>$status/<code>,/</code>$date/<code>)/</code><code>); $qid = $diy_db->insertid(); In file /diy-cms/modules/poll/edit.php line: 69 - 76 $result = $diy_db->query(/</code><code>update diy_poll_questions set question=/</code>$question/<code>, type=/</code>$type/<code>, status=/</code>$status/<code> where qid=/</code>$qid/<code>/</code><code>); foreach ($_POST[/</code>answer/<code>] as $answer) { $answer = $answer; if (!empty($answer)) { $diy_db->query(/</code><code>update diy_poll_answers set answer=/</code>$answer/<code> where aid=/</code>$aid/<code> /</code><code>); } we edit to: $question = htmlspecialchars(strip_tags($question)); $result = $diy_db->query(/</code><code>update diy_poll_questions set question=/</code>$question/<code>, type=/</code>$type/<code>, status=/</code>$status/<code> where qid=/</code>$qid/<code>/</code><code>); foreach ($_POST[/</code>answer/<code>] as $answer) { $answer = htmlspecialchars(strip_tags($answer)); if (!empty($answer)) { $diy_db->query(/</code><code>update diy_poll_answers set answer=/</code>$answer/<code> where aid=/</code>$aid/<code> </code>`); } 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: ======== Vulnerability Laboratory [Research Team]-snup (snup () vulnerability-lab com) Disclaimer: =========== 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. Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability- Lab. 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 or its suppliers. Copyright © 2012 Vulnerability-Lab -- VULNERABILITY RESEARCH LABORATORY TEAM Website: www.vulnerability-lab.com Mail: research () vulnerability-lab com |