WordPress A Page Flip Book plugin local file inclusion vulnerability

Advisory
Secunia Advisory SA 49505

Analysis
A page flip book for WordPress allows for different languages to be used. This is toggled by posting “pageflipbook_language” to the blog, which will update an option and then include the appropiate language. This is done in the main file, pageflipbook.php, which is always included.

We can see that it checks if “pageflipbook_language” is included in a POST parameter on line 30, it will update the option on the blog, otherwise it will pull the language value from the option and put that into the variable. This value is supposed to be the name of a php file. After that, it will include the chosen language file on line 47.

But because there is no validation that the file is a valid language file and there is no directory transversal, we can do a local file inclusion attack on this:

WordPress Symposium plugin multiple SQL injection vulnerabilities

Advisory
Secunia Advisory SA 49534

Analysis of group_menu_settings vulnerability
The group_menu_settings function in /ajax/symposium_group_functions.php allows an user to show settings for a group. The function takes a POST parameter called “uid1″, which is used for a sql query.

However due to an incorrect use of wpdb->prepare, the groupID is never sanitized. Also the function does not check user credentials until line 616, and as such allows for a SQL injection through a simple POST request like this:

Analysis of loadComposeForm vulnerability
The loadComposeForm function in /ajax/symposium_mail_functions.php is used to fetch the display name of an userID through a simple SQL query like this:

It first checks if the user is logged in, and then takes to mail_to POST parameter and append it to the query. But because there is no validation that the mail_to variable is in fact an integer, we can make a POST request if we have an authentication cookie, and exploit this SQL injection vulnerability:

Analysis of getReply vulnerability
The getReply function in /ajax/symposium_mail_functions.php is used to fetch the display name of a recipient and message information about a particular mail.

It first checks if the user is logged in, and then takes to mail_id and recipient_id POST parameter and stitches those into 2 SQL queries using simple concatenation. However due to a lack of validation of the parameters being integers, we can exploit this:

Analysis of symposium_openchat vulnerability
The symposium_openchat function in /ajax/symposium_bar_functions.php allows for opening a chat with another user on the site. It does so by getting the chat_to POST parameter, which si expected to be an integer, and then checks if that chat already exists:

If you’re logged in and the chat does not exist, on line 572 it will then insert a new chat and select the display name from the user table, and incorrectly use the wpdb_prepare function. By rather concatenating the ID in instead of passing it as a parameter, we can now select data out of the database like this:

Analysis of getEditDetails vulnerability
The getEditDetails function in /ajax/symposium_forum_functions.php gets the contents of a post for the edit page.

It checks if you’re logged in, and then takes the tid POST parameter and concatenates it into a SQL query without casting it to an integer or otherwise sanitizes it. This means we can exploit it by making a request like this:

Multiple blind injection spots in /ajax/symposium_mail_functions.php
On line 94, 101, 208, 210, 274, 276 in /ajax/symposium_mail_functions.php there is also a lack of validation of integer inputs, which allows for arbitrary query execution.

WordPress Quotes Collection plugin cross-site request forgery vulnerability

Advisory
Secunia Advisory SA 49653

Analysis
A type of vulnerability that seems to be fairly common is CSRF. You can obviously speculate as to why, but I found this interesting one. I normally won’t publish CSRF vulnerabilities, but there are cases where they can abuse the inherent trust that is put in an admin to not attempt to exploit the blog readers.

In this case, because the admin pages did not make use of nonces, we are able to craft a page which will make the user make a GET request with a XSS payload, which will at no point be sanitized besides being escaped for inserting into the database.

If we either make this request directly, simulating a CSRF attack, or actually create a malicious page and convince an admin on a WordPress blog with this plugin to click on your link, we can cause a persistent XSS due to the lack of a nonce and sanitizing of html input.

WordPress Zingiri Shop plugin “abspath” remote file inclusion vulnerability

Advisory
Secunia Advisory SA 49676

Analysis
I had been looking at this particular piece of code for a while. At a glance, while the handling of the looks somewhat safe due to the validation that the input path is in fact a directory, so at best you could sort of chain an exploit with this. The question is, how could you take this to a RFI? Lets look at /fws/download.php:

As you see, this may very well look safe at a glance. For us to be able to exploit the fact that the ‘abspath’ variable is user controlled, we need to get a true back from is_dir. I checked with google how to pull this off when providing a remote host. This isn’t possible with HTTP, and nobody suggested an alternative. For this to work, the protocol wrapper needs to support the “stat()” family of functions. HTTP isn’t one of these. But as it turns out, FTP is. Bingo! We now have a piece of code that through a very specific detail in the PHP implementation, that we can exploit.

By putting up a FTP server with some specified credentials, and a file called wp-blog-header.php with some malicious PHP, we can include an URL in the abspath GET parameter, which will exploit this vulnerability:

WordPress Mac Photo Gallery plugin “albid” arbitrary file disclosure vulnerability

Advisory
Secunia Advisory SA 49650

Analysis
This vulnerability relies on a lack of validation of the “albid” in macdownload.php, which is passed straight into the path that is read at line 37 into the response. This cases an arbitrary file disclosure vulnerability.

If we make a request like this, it will cause the code to read out the wp-config.php file, which will contain database credentials in.

WordPress Nmedia MailChimp widget “abs_path” remote file inclusion vulnerability

Advisory
Secunia Advisory SA 49538

Analysis
This vulnerability is nothing but a textbook arbitrary file inclusion vulnerability. The file is used to interacting with the mailchimp API. But the very first 2 lines of executable code in /api_mailchimp/postToMailChimp.php, it goes ahead and accepts a path for loading a file.

By making following request, where the url has a file called ‘wp-load.php’ or otherwise will return php code, or using the proof of concept code, we can exploit this

Proof of concept code

WordPress TheCartPress plugin order information security bypass

Advisory
Secunia Advisory SA 49652

Analysis
TheCartPress has functionality for an admin to view and print an order. This functionality extends also to the customer to print the order. By providing the orderID, the user can view and print the order. However there was a distinct lack of any validation about whether or not the user requesting the order owned it.

The entry point to print an order is /admin/PrintOrder.php:

This fetches the template that is going to be used to used for the page to be printed. By default, this is /theme-templates/tcp_print_order.php:

The template goes ahead and passes on the order_id in the request to the OrderPage::show method. Notice that at no point has there been any validation of the order belonging to the user requesting the page. Anyway, we call into the show method, which is in fact the only method on the OrderPage class in /classes/OrderPage.class.php:

This method effectively just fetches the order from database, and then returns it. There’s no reference to the active user, which is the gist of this vulnerability. A lack of validation of the requesting user being also the owner of the order, or an admin.

WordPress Profile Builder plugin vertical privilege escalation

Advisory
Secunia Advisory SA 49201

Analysis

Profile builder implemented its own password recovery system on top of the existing wordpress system in /front-end/wppb.recover.password.php. It does so by taking a request with a password reset key which is generated using a statically salted md5 hash of the user name, userID and two static strings, both computed when the password reset mail is send and then calculated again when the user accesses the link provided in the password reset mail.

As you can see, we fetch the userID associated with the provided user name, and then proceed to recalculate the hash and compare that against the key provided. If those match, you can now change the password.

Because this value is not at all random, it allows us to calculate this value for any user granted that we know the user name and user id(Which could easily be guessed for most sites by iterating through even a small sequenstial list of numbers), and subsequently change their password even if they did not request it, causing a vertical privilege escalation vulnerability.

Proof of concept code