Analysis of WordPress 3D Print Lite 1.9.1.4 - arbitrary file upload vulnerability.

Overview

3DPrint-Lite-1.9.1.4-File-Upload

Analysis of WordPress 3D Print Lite 1.9.1.4 - arbitrary file upload vulnerability.

The Vulnerability:

This vulnerability allow an unauthenticated attacker to upload attribute file to the target host, the files will be uploaded in /wp-content/uploads/p3d directory, this is due to the application that does not perform any verification process of the file extension when uploading it other than escaping functions, as we can see in p3dlite_handle_upload function. The function can be accessed by p33dlite_handle_upload ajax action add_action( 'wp_ajax_p3dlite_handle_upload', 'p3dlite_handle_upload' ); in https://github.com/RyouYoo/3DPrint-Lite-1.9.1.4-File-Upload/blob/2fc9594edd7ffc6d8bbbf02d795a9444331e58dc/3dprint-lite/3dprint-lite.php#L25.

The application using fopen() function to create and write into files, fopen() function without any additional checks can be used to upload files in another directory that we shouldn't be able to upload to, but in this case, the developer did add two functions to prevent this behavior:

function p3dlite_basename($file) {
	$array=explode('/',$file);
	$base=array_pop($array);
	return $base;
} 

function p3dlite_extension($file) {
	$array=explode('.',$file);
	$ext=array_pop($array);
	return $ext;
} 

https://github.com/RyouYoo/3DPrint-Lite-1.9.1.4-File-Upload/blob/2fc9594edd7ffc6d8bbbf02d795a9444331e58dc/3dprint-lite/includes/3dprint-lite-functions.php#L967

These functions make sure to take only the base file name and pass it to the function fopen(), so trying to upload a file with malicious name like: "../shell.php" won't work, trying to upload a double extension file also won't work in which case test.php.jpg will be uploaded with the name test.php_.jpg.

☁  3DPrint-Lite-1.9.1.4-File-Upload [main] ⚡  ./exploit.sh http://jakom.com
{"jsonrpc":"2.0","filename":"1632779012_test.php_.jpg"}%
☁  3DPrint-Lite-1.9.1.4-File-Upload [main] ⚡

The attacker will not be able to access the uploaded files that match the FilesMatch regex in the .htaccess file in /wp-content/uploads/p3d/.

Order Deny,Allow Deny from all ExpiresActive on ExpiresDefault "access plus 365 days" Header set Cache-Control "max-age=31536050" ">
AddType application/octet-stream obj
AddType application/octet-stream stl

   
    
        AddOutputFilterByType DEFLATE application/octet-stream

   

   
    
        Order Deny,Allow
        Deny from all

   

   
    
        ExpiresActive on
        ExpiresDefault "access plus 365 days"

   

   
    
        Header set Cache-Control "max-age=31536050"

   

image

So getting Remote Code Execution in the target host is not part of this vulnerability.

Conclusion:

In the end this vulnerability has a low impact in the target, and it can be only used to upload non-harmful files in the host target.

You might also like...

Deploy WordPress plugin and theme to the wordpress.org plugin directory.

wp-deployer Deploy WordPress plugin and theme to the wordpress.org plugin directory. Install npm install --save-dev wp-deployer Settings slug : Plugin

Sep 6, 2022

Plupload is JavaScript API for building file uploaders. It supports multiple file selection, file filtering, chunked upload, client side image downsizing and when necessary can fallback to alternative runtimes, like Flash and Silverlight.

Plupload Plupload is a cross-browser multi-runtime file uploading API. Basically, a set of tools that will help you to build a reliable and visually a

Jan 1, 2023

Scheme flooding vulnerability: how it works and why it is a threat to anonymous browsing

Scheme flooding vulnerability: how it works and why it is a threat to anonymous browsing

Dec 28, 2022

client-side prototype pullution vulnerability scanner

client-side prototype pullution vulnerability scanner

JSPanda JSpanda is client-side prototype pollution vulnerability scanner. It has two key features, scanning vulnerability the supplied URLs and analyz

Dec 25, 2022

EasyPen is a GUI program which helps pentesters do target discovery, vulnerability scan and exploitation

EasyPen is a GUI program which helps pentesters do target discovery, vulnerability scan and exploitation

EasyPen Alpha 1.0.5 Do not use EasyPen for illegal purposes, this tool is for research only 查看中文 EasyPen is a GUI program which helps pentesters do ta

Dec 25, 2022

This is an upload script which allows you to upload to web3 storage using JS.

This is an upload script which allows you to upload to web3 storage using JS. first make sure to run npm install on the directory run script using nod

Dec 24, 2021

Upload or Upload & Publish your bundle (apk or aab) to Huawei AppGallery with ConnectApi

appgallery-publisher Upload/Publish your bundle (apk or aab) to AppGallery automatically with appgallery-publisher Usage Single Javascript File Bash F

Sep 19, 2022

PostCSS plugin to render WordPress global styles from a theme.json file

postcss-wp-global-styles PostCSS plugin to render WordPress global styles from a theme.json file. As of now it only supports preset styles. Usage @wp-

Aug 5, 2022

An arbitrary size Bit-Vector implementation in JavaScript

An arbitrary size Bit-Vector implementation in JavaScript

BitSet.js BitSet.js is an infinite Bit-Array (aka bit vector, bit string, bit set) implementation in JavaScript. That means that if you invert a bit v

Dec 9, 2022

Run arbitrary WASM/WASI files

Run arbitrary WASM/WASI files

Dec 31, 2022

🚀AI拟声: 5秒内克隆您的声音并生成任意语音内容 Clone a voice in 5 seconds to generate arbitrary speech in real-time

🚀AI拟声: 5秒内克隆您的声音并生成任意语音内容 Clone a voice in 5 seconds to generate arbitrary speech in real-time

English | 中文 Features 🌍 Chinese supported mandarin and tested with multiple datasets: aidatatang_200zh, magicdata, aishell3, and etc. 🤩 PyTorch work

Dec 29, 2022

A good web interface for youtube-dl that allows you to download arbitrary mixes of audio and video, including up to the highest quality such as 8K.

A good web interface for youtube-dl that allows you to download arbitrary mixes of audio and video, including up to the highest quality such as 8K.

🚀 youtube-dl-web A good web interface for youtube-dl that allows you to download arbitrary mixes of audio and video, including up to the highest qual

Dec 30, 2022

Serialize arbitrary NodeJS closures and customize serialization behavior.

Closure Serializer This is a fork of the Pulumi Closure Serializer. @pulumi/pulumi. Motivation Functionless allows developers to write cloud applicati

Jul 19, 2022

Render arbitrary Markdown content in Astro, optionally integrating with any existing configuration.

Astro Markdown Astro Markdown lets you render arbitrary Markdown content in Astro, optionally integrating with any existing configuration. --- import

Dec 22, 2022

Scrape tweets from Twitter search results based on keywords and date range using Playwright. Save scraped tweets in a CSV file for easy analysis

Tweet Harvest (Twitter Crawler) Tweet Harvest is a command-line tool that uses Playwright to scrape tweets from Twitter search results based on specif

Aug 9, 2023

A JavaScript, zero-dependency, super small version of IP2Location LITE country lookups.

ip3country This is a zero-dependency, super small, IP address to 2-letter country code lookup library. There are already several libraries available,

Dec 14, 2022

Compile optimized Vega and Vega-Lite bundles.

vega-bundler Utilities for pre-parsing Vega and Vega-Lite specifications and producing optimized module bundles. Both and Vega and Vega-Lite have thei

Jul 29, 2021

A JavaScript, zero-dependency, super small version of IP2Location LITE country lookups.

A JavaScript, zero-dependency, super small version of IP2Location LITE country lookups.

Dec 14, 2022

Material Design Lite for Ember.js Apps

Material Design Lite for Ember.js Apps

ember-material-lite Google's Material Design Lite for Ember.js apps This addon requires ember = 1.11.0 Installation # ember-cli 0.2.3 ember install

Dec 17, 2021
Owner
Jakom
sigma rule #00: automate everything, email: [email protected]
Jakom
An arbitrary size Bit-Vector implementation in JavaScript

BitSet.js BitSet.js is an infinite Bit-Array (aka bit vector, bit string, bit set) implementation in JavaScript. That means that if you invert a bit v

Robert Eisele 207 Dec 9, 2022
Run arbitrary WASM/WASI files

Run arbitrary WASM/WASI files

Wasm3 Labs 60 Dec 31, 2022
A JavaScript, zero-dependency, super small version of IP2Location LITE country lookups.

A JavaScript, zero-dependency, super small version of IP2Location LITE country lookups.

Statsig 34 Dec 14, 2022
LNMarkets.com trading bot using TradingView Technical Analysis to automatically trade

#Warning Educational only. Use it at your own risk. I am not responsible for any financial loss. LNMarkets_Trading_Bot LNMarkets.com trading bot using

RielBitcoin 6 Sep 16, 2022
NodeJS application to upload an image to a S3 Bucket on AWS.

node-upload-image-to-s3-bucket NodeJS application to upload an image to a S3 Bucket on AWS. How it works: You must make a POST request to /upload-imag

Rafael Silva de Lima 6 Sep 28, 2022
A Featureful File Browser for Cockpit

Cockpit Navigator A Featureful File System Browser for Cockpit - remotely browse, manage, edit, upload, and download files on your server through your

45Drives 226 Dec 27, 2022
Generate HTML redirections from json file

Generate HTML redirections from json file

Andrew Luca 3 Jan 6, 2022
Bootstrap-print-css - Print Stylesheet for Bootstrap 5

Bootstrap Print CSS ??️ Bootstrap 5 no longer includes custom CSS for printing - with the CSS in this project you can add it back. Note: This should i

Christian Oliff 35 Dec 13, 2022
Pretty-print-json - 🦋 Pretty-print JSON data into HTML to indent and colorize (written in TypeScript)

pretty-print-json Pretty-print JSON data into HTML to indent and colorize (written in TypeScript) 1) Try It Out Interactive online tool to format JSON

Center Key 87 Dec 30, 2022