what you don't know can hurt you

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
MD5 | a23fbe7a9101f368564e24a1ccaad929

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:

December 2020

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close