exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

WordPress Fancy Product Designer For WooCommerce 4.5.1 File Upload

WordPress Fancy Product Designer For WooCommerce 4.5.1 File Upload
Posted Nov 18, 2020
Authored by Jonathan Gregson

WordPress Fancy Product Designer for WooCommerce plugin versions 4.5.1 and below suffer from an unauthenticated arbitrary file upload vulnerability.

tags | exploit, arbitrary, file upload
SHA-256 | 844ca1d83aa4d76c3672b1a8922c9d8024975940f595d849d240dc34d1d9305e

WordPress Fancy Product Designer For WooCommerce 4.5.1 File Upload

Change Mirror Download
## About Fancy Product Designer for WooCommerce
Fancy Product Designer for WooCommerce is a WordPress plugin which allows users to design custom products in a vendor's WooCommerce store. It is sold through the third-party marketplace "Envato Market" and boasts over 15,000 sales.

## Unrestricted File Upload
Fancy Product Designer for WooCommerce before and including version 4.5.1 contains an Unrestricted File Upload vulnerability.

An unauthenticated attacker is able to upload any type of file to an affected WooCommerce store by exploiting a Time of Check, Time of Use (TOCTOU) weakness in custom-image-handler.php's `url` parameter. However, the file will be saved with one of the following extensions on the server: jpeg, png, or svg.

Fancy Product Designer for WooCommerce provides an option to require users to log in before uploading images. However, an attacker is able to access the custom-image-handler.php file directly and upload arbitrary files without authentication.

### Details
The custom-image-handler.php file provides an interface where unauthenticated users can provide the URL of an image and have that image saved on the server. Before saving the file, custom-image-handler.php first checks the MIME type of the file and confirms that it is one of the following: jpeg, png, or svg. Once the file's MIME type has been verified, custom-image-handler.php downloads the file a second time and saves the most recent copy to the filesystem with an extension corresponding to the MIME type of the originally verified file.

This vulnerability can be exploited by sending a POST request to the following URL of an affected WooCommerce site:

/wp-content/plugins/fancy-product-designer/inc/custom-image-handler.php

With this request, the following POST parameters should be sent as form data:
- saveOnServer: 1
- uploadsDirURL: https://[affected site]/wp-content/uploads/fancy_products_uploads/
- uploadsDir: [full path to where the file should be saved on the server]
- url: [attacker-controlled URL]

The attacker-controlled URL should initially point to a valid file of type: jpeg, png, or svg. Once a request has been made for the file, the attacker can replace the file at the attacker-controlled URL with a malicious file, and the malicious file will be saved on the server. The URL of the uploaded file will then be returned to the attacker in response to the POST request.

Note: The default values for the `uploadsDirURL` and `uploadsDir` parameters can be found by searching for the same strings in the source of any page using an affected version of Fancy Product Designer for WooCommerce. Attackers are also able to provide local file paths, which will cause FPD to copy the specified file into the uploads directory if the file is one of the expected types and the server is running with sufficient permissions to read the file.

### Impact
The fact that the uploaded file will have one of the previously mentioned extensions greatly mitigates the impact of this vulnerability, as none of the allowed extensions will be executed by the server. The following scenarios are plausible by abusing this vulnerability:
- Stored XSS by uploading an SVG containing a malicious JavaScript payload
- Malware distribution by uploading malicious binaries and other payloads

### Proof of Concept
- Exploit code: [poc.php](https://github.com/jdgregson/Disclosures/blob/master/fancy-product-designer/unrestricted-file-upload/poc.php)
- Demo video: [unrestricted-file-upload.mp4](https://raw.githubusercontent.com/jdgregson/Disclosures/master/fancy-product-designer/unrestricted-file-upload/unrestricted-file-upload.mp4)

### Disclosure Timeline
- 10/11/2020: issue reported via ticket on developer's support forum
- 10/11/2020: ticket closed by developer with no response
- 10/20/2020: developer released an update which did not address the issue
- 10/26/2020: developer released an update which did not address the issue
- 11/14/2020: full disclosure



Login or Register to add favorites

File Archive:

August 2022

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close