Home » wordpress plugin » Page 7

Tag: wordpress plugin

WordPress Download Manager < 2.8.8 Critical Security Vulnerabilities

I discovered that the WordPress Download Manager contains some very serious security vulnerabilities. The free version available on wordpress.org claims to have 80,000+ active installs (as of 1/19/2016), the company also sells a pro version that has an unknown number of installs.

There are multiple different vulnerabilities in the plugin, I do not have access to the pro version so I can not verify if all of the vulnerabilities are resolved or if there are additional similar vulnerabilities.

Unauthenticated Directory listings

The wpdm_dir_tree() function is called during the ‘init’ action and without any authorization checks preventing it from working. A user can pass the HTTP GET variable ‘task=wpdm_dir_tree’ and the HTTP POST variable ‘dir’ containing a directory and the server will return a listing of the files in that directory.

wpdm_dirlist1

Unauthenticated post updating

The savePackage() function gets called by the ‘wp’ action, there are lots of fun things you can do with this function and none of it requires any type of authorization. I won’t spell out exactly what you need to do but it’s quite simple to use this to associate any file on the filesystem with a post.

wpdm_savepackage

Later in the function it takes arbitrary user data and updates the post meta for a specific post.

wpdm_savepackage1

Then someone can use the WPDM builtin capabilities to download a file associated with a specific post. I was able to use this mechanism to download arbitrary files from the host.

Privilege Escalation

This last piece requires you have a valid account on the WordPress host, though if registration is enabled on the host the WPDM plugin makes it even easier to create an account. Through the magic of the extract($_POST) function a user can pass in any of the parameters that get sent to the wp_update_user() WordPress function. Many of these options the user can usually change via their profile settings, but the ‘role’ is usually one that should only be adjusted by the Administrator.

wpdm_updateprofile

The extract function needs to be used very carefully (if at all), especially when passing in an array of user supplied data (like $_POST, $_GET, $_REQUEST, etc.).

Timeline

  • 1/10/2016 Initial contact via webform to determine contact information
  • 1/11/2016 11:51am Contact address received
  • 1/11/2016 1:38pm Initial full disclosure
  • 1/11/2016 2:45pm Additional information discovered and disclosed
  • 1/11/2016 10:15pm Updated version released that did not completely resolve issue
  • 1/12/2016 Vendor released new versions and posted blog

Simple Download Monitor 3.2.8 Security Vulnerability

The WordPress plugin Simple Download Monitor has a few security vulnerabilities that allows unauthenticated users to list all uploaded files, delete thumbnails associated with them, and uploaded files with password protection can be download without entering a password.

As of 1/19/2016 the wordpress.org information says there are 10,000+ active installs of this plugin.

The vendor Tips and Tricks HQ has released version 3.2.9 to resolve this issue.

List all uploaded files

Unauthenticated AJAX allows any user to access the ‘sdm_tiny_get_post_ids’ action which will return a JSON encoded list of all ‘post_id’ and ‘post_title’ that were uploaded with the Simple Download Monitor plugin. In many cases these files are publicly visible already so this isn’t a major security issue in most cases.

sdm_ajax_list

Delete thumbnails

Unauthenticated AJAX calls again allow any unauthenticated user to delete thumbnail images that were added using this plugin via the ‘sdm_remove_thumbnail_image’ action.

sdm_ajax_delete

Download files without password protection

This is the biggest security issue here, they do provide an AJAX command that verifies the post password to allow downloading the file but there is also this backdoor method to access the file that can be used without any password verification. Though the access is logged if logging is enabled.

sdm_view_init

Early on by the ‘init’ action the handle_sdm_download_via_direct_post() function is called. Which then takes the supplied ‘download_id’ and retrieves the post containing a file.

sdm_download_part1

After the bit of logging it finally happily redirects the user to the proper download URL.

sdm_download_part2

One additional note, these files are not actually password protected, just the posts that contain them. So if someone has the direct URL to a file they can download it without any further authorization.

It’s always wise to ensure that any request is properly authorized.

Timeline

  • 1/12/2016 2:16pm Initial contact email sent to find appropriate security/developer contact
  • 1/12/2016 10:16pm Vendor responds with contact information
  • 1/13/2016 10:16am Complete disclosure sent
  • 1/14/2016 7:31pm Vendor reply stating they are working on issue and requested more information
  • 1/16/2016 7:37pm Vendor reply stating a new version has been released

WP Ultimate CSV Importer 3.7.1 Critical Vulnerability

WP Ultimate CSV Importer plugin also available free on wordpress.org allows direct calling to code that can read files on the filesystem without authorization. The WordPress plugin directory reports there are 10,000+ active installs of this plugin.

This is a very serious issue that allows unprotected read access to any file that the user running php has access to.

wpultimatecsvimporter

templates/readfile.php can be called directly to read any file via directory traversal. You would have to iterate over each line in the file, but that is a trivial task.

On 3/30/2015 a new version was released to fix this issue. Here is the new code.

wpultimatecsvimporter1

Unfortunately, that just added a tiny road bump to the issue. Since ‘HTTP_REFERER’ is trivial to set, you just need to do a bit more work to include that as well and it is easily scriptable.

wpultimatecsvimporter-readfile

Here is the final fix added.  Which does what is essentially the commonly recommended WordPress security practice of not allowing a script to be called directly.

wpultimatecsvimporter-security

In almost every case there is no reason to allow code to be called directly. If you have the WordPress tools available to you then you should use them. Something like current_user_can() and a nonce should always be used.

Timeline

  • 3/26/2015 12:30am Sent inital contact to vendor
  • 3/26/2015 4:16am Email received from “Sales” requesting more info
  • 3/26/2015 8:49am Vulnerability information sent to vendor
  • 3/26/2015 9:15am Vendor says information forwareded to developer
  • 3/30/2015 9:38am Vendor notified that the issue is resolved in version 3.6.78
  • 4/14/2015 10:20am In preperation to post, determined that their fix was insufficient.  Re-contact vendor
  • 4/16/2015 7:42am Re-contact vendor to check status
  • 4/16/2015 9:14pm Vendor replied saying they are working on it and would follow up when resolved (they never did)
  • 4/20/2015 Version 3.7.1 released