{"id":6593219,"date":"2015-09-28T19:21:21","date_gmt":"2015-09-28T19:21:21","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/sql-injection-13\/"},"modified":"2016-08-30T18:30:31","modified_gmt":"2016-08-30T18:30:31","slug":"sql-injection-13","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/sql-injection-13\/","title":{"rendered":"SQL injection"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I think I found SQL injection in  custom-maintenance-mode via POST request to cmmemail argument in ajax_subscriber.php:<br \/>\n`<br \/>\n   19\t\t$wpuser_result = $wpdb-&gt;get_results(&#8220;SELECT * FROM &#8220;.$table_name.&#8221; WHERE cmm_email='&#8221;.$_GET[&#8216;cmmemail&#8217;].&#8221;&#8216;&#8221;);<br \/>\n    20<br \/>\n    21\t\tforeach ( $wpuser_result as $userdetails ) {<br \/>\n    22\t\t$cmm_email       = $userdetails-&gt;cmm_email;<br \/>\n    23\t\t}<br \/>\n    24\t\tif($cmm_email!=&#8221;&#8221;)<br \/>\n    25\t\t{<br \/>\n    26\t\t\techo $msg = &#8220;Aleardy&#8221;;<br \/>\n    27\t\t}<br \/>\n    28\t\telse<br \/>\n    29\t\t{   $wpdb-&gt;insert( $table_name, array( &#8216;cmm_email&#8217; =&gt; $_GET[&#8216;cmmemail&#8217;], &#8216;cmm_date&#8217; =&gt; date(&#8216;Y:m:d H:i:s&#8217;)) );<br \/>\n    30\t\t\techo $msg = &#8220;Success&#8221;;<br \/>\n    31\t\t}<br \/>\n&#8216;<\/p>\n<p>https:\/\/wordpress.org\/plugins\/custom-maintenance-mode\/<\/p>\n","protected":false},"template":"","class_list":["post-6593219","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6593219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6593219\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6593219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}