Tried, Tested and Proven

Vulnerability title: Multiple Authenticated SQL Injections in EllisLab ExpressionEngine Core

CVE: CVE-2014-5387
Vendor: EllisLab
Product: ExpressionEngine Core
Affected version: Version 2.9.0 and possibly earlier
Fixed version: 2.9.1
Reported by: Jerzy Kramarz and Alex Murillo Moya

Details:

SQL injection has been found and confirmed within the software as an authenticated user. A successful attack could allow an authenticated attacker to access information such as usernames and password hashes that are stored in the database.

The following URLs and parameters have been confirmed to suffer from multiple SQL injections:

Vulnerability 1

POST /ex/system/index.php?S=d80babaf271e481ba9a8fde69dd72b28&D=cp&C=addons_modules&M=show_module_cp&module=comment HTTP/1.1
Host: 192.168.56.103
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-CSRF-TOKEN: e5806ae56ad19f2124a4a22e517b00dfd47d2c32
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://192.168.56.103/ex/system/index.php?/cp/addons_modules/show_module_cp&module=comment&S=d80babaf271e481ba9a8fde69dd72b28
Content-Length: 243
Cookie: [...]
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

tbl_sort%5B0%5D%5B%5D=comment_date<SQL Injection>&tbl_sort%5B0%5D%5B%5D=asc&csrf_token=e5806ae56ad19f2124a4a22e517b00dfd47d2c32&keywords=&XID=e5806ae56ad19f2124a4a22e517b00dfd47d2c32

Vulnerability 2

POST /ExpressEngine/system/index.php?S=5711f695056db582aa7427787f525d6f&D=cp&C=members&M=view_all_members HTTP/1.1
Host: 192.168.56.103
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-CSRF-TOKEN: e5806ae56ad19f2124a4a22e517b00dfd47d2c32
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cookie: [...]
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

csrf_token=ee4[...]&member_name=1&column_filter=all<SQL Injection>&XID=ee4[...]

Vulnerability 3

POST /ExpressEngine/system/index.php?/cp/content_publish/entry_form&channel_id=2&entry_id=3&filter=YToxOntzOjEwOiJjaGFubmVsX2lkIjtzOjE6IjIiO30%3D&S=5711f695056db582aa7427787f525d6f HTTP/1.1
Host: 192.168.56.103
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.56.103/ExpressEngine/system/index.php?/cp/content_publish/entry_form&channel_id=2&entry_id=3&filter=YToxOntzOjEwOiJjaGFubmVsX2lkIjtzOjE6IjIiO30=&S=5711f695056db582aa7427787f525d6f
Cookie: [...]
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------317032379522964
Content-Length: 4607

-----------------------------317032379522964
Content-Disposition: form-data; name="entry_id" 

3
-----------------------------317032379522964
Content-Disposition: form-data; name="channel_id" 

2
-----------------------------317032379522964
Content-Disposition: form-data; name="autosave_entry_id" 

0
-----------------------------317032379522964
Content-Disposition: form-data; name="filter" 

YToxOntzOjEwOiJjaGFubmVsX2lkIjtzOjE6IjIiO30=
-----------------------------317032379522964
Content-Disposition: form-data; name="csrf_token" 

468a1cb7f860c43937e82527bb0c2dd0fea381e6
-----------------------------317032379522964
Content-Disposition: form-data; name="member_group[]" 

1
-----------------------------317032379522964
Content-Disposition: form-data; name="layout_preview" 

1
-----------------------------317032379522964
Content-Disposition: form-data; name="title" 

About the Label
-----------------------------317032379522964
Content-Disposition: form-data; name="url_title" 

about_the_label
-----------------------------317032379522964
Content-Disposition: form-data; name="field_id_4" 

text

-----------------------------317032379522964
Content-Disposition: form-data; name="field_ft_4" 

xhtml
-----------------------------317032379522964
Content-Disposition: form-data; name="field_id_5_hidden_file" 

map2.jpg
-----------------------------317032379522964
Content-Disposition: form-data; name="field_id_5_hidden_dir" 

2
-----------------------------317032379522964
Content-Disposition: form-data; name="field_id_5"; filename="" 
Content-Type: application/octet-stream

-----------------------------317032379522964
Content-Disposition: form-data; name="field_id_5_directory" 

2
-----------------------------317032379522964
Content-Disposition: form-data; name="field_id_6" 

-----------------------------317032379522964
Content-Disposition: form-data; name="field_id_7" 

1
-----------------------------317032379522964
Content-Disposition: form-data; name="field_ft_7" 

xhtml
-----------------------------317032379522964
Content-Disposition: form-data; name="entry_date" 

8/13/14 2:02 PM
-----------------------------317032379522964
Content-Disposition: form-data; name="expiration_date" 

-----------------------------317032379522964
Content-Disposition: form-data; name="comment_expiration_date" 

-----------------------------317032379522964
Content-Disposition: form-data; name="category[]" 

4<SQL Injection>
-----------------------------317032379522964
Content-Disposition: form-data; name="category[]" 

3<SQL Injection>
-----------------------------317032379522964
Content-Disposition: form-data; name="new_channel" 

2
-----------------------------317032379522964
Content-Disposition: form-data; name="status" 

open
-----------------------------317032379522964
Content-Disposition: form-data; name="author" 

1
-----------------------------317032379522964
Content-Disposition: form-data; name="sticky" 

y
-----------------------------317032379522964
Content-Disposition: form-data; name="allow_comments" 

y
-----------------------------317032379522964
Content-Disposition: form-data; name="pages__pages_uri" 

/asd
-----------------------------317032379522964
Content-Disposition: form-data; name="pages__pages_template_id" 

4
-----------------------------317032379522964
Content-Disposition: form-data; name="submit" 

Submit
-----------------------------317032379522964--

Impact:

An attacker would be able to exfiltrate the database, user credentials and in certain setup access the underling operating system.

Exploit:

Exploit code is not required.

Vendor status:

13/08/2014 Advisory created
14/08/2014 Vendor contacted
18/08/2014 Vendor working on a fix
27/08/2014 Fix confirmed
27/08/2014 CVE obtained
03/10/2014 Fix released
13/10/2014 Published
Copyright:

Copyright © Portcullis Computer Security Limited 2014, All rights reserved worldwide. Permission is hereby granted for the electronic redistribution of this information. It is not to be edited or altered in any way without the express written consent of Portcullis Computer Security Limited.

Disclaimer:

The information herein contained may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user’s risk. In no event shall the author/distributor (Portcullis Computer Security Limited) be held liable for any damages whatsoever arising out of or in connection with the use or spread of this information.