iThemes Security: Critical Security Release

iThemes have released an important security fix for their iThemes Security Plugin.

This release fixes an XSS issue, which allowed potentially dangerous JavaScript to be executed while viewing the iThemes Security 404 error logs.

iThemes have backported the security fix to past versions, releasing a patched version of every minor version dating back to 3.2.

In order to protect your site, we recommend that you check if your site is running a vulnerable version of iThemes Security, and upgrade it immediately to a safe version. You can do so from the “Updates” page in your WordPress dashboard.

We have attempted to push an update to all websites on VaultPress, upgrading them to the safe release of the minor version they were already using. However, we were unable to update some websites due to permission issues.

We have emailed all VaultPress customers whose sites have not been successfully updated.

As always, if you have any questions or need help, drop us a message!

Posted in General, Security | 1 Comment

Vulnerability in WP Super Cache

A couple of important security updates have been released for the popular WP Super Cache plugin.

The security updates fixed a vulnerability, reported by Sucuri, that allowed an attacker to introduce malicious code into the plugin’s cache file listing.

Many such vulnerabilities are executed by tricking the site owner into clicking on a dangerous link. However, since links pointing to the WP Super Cache cache listing page can only be used once, it would not be possible to execute the malicious code by clicking on a public link. In order to execute the malicious code, the site owner would need to visit the plugin’s cache listing page manually.

You can protect yourself from this security vulnerability by upgrading to the latest version of WP Super Cache, 1.4.4, under Dashboard → Updates in your WordPress dashboard.

We have also attempted to automatically upgrade any VaultPress customers that are running an outdated version of WP Super Cache. You can verify that you’re running the latest version of WP Super Cache, 1.4.4, on the Plugins page in your WordPress dashboard.

As always, if you have any questions, drop us a line!

Posted in General, Security | Tagged | 2 Comments

VaultPress Customer Stories: Attack of the Androids

MatLee2Mat’s podcasts are a therapy of sorts for him. After starting a couple of other podcasts, he launched the Attack of the Androids to cover all things Android. The focus of the podcast is to discuss Android news, reviews, and awesome Android apps.

He turned to podcasts in part because they felt more genuine. “Anyone can write and edit but it takes a certain someone to be real in front of a mic and camera,” he says.

Since putting himself and his thoughts out there, he’s drawn a loyal following. So much so that he’s been amazed at how long some of his listeners have been around for. “Some of those kids started listening in high school, and now they are graduating college and getting jobs,” he mentioned.

Part of his success has been the use of WordPress to quickly and easily publish his podcasts. Recently, he started using VaultPress to keep his content safe, because it seemed like the “only complete way to have multiple snapshots of full backups”. 

When the time came to move to a new server, he turned to VaultPress and performed an alternate restore. Now his sites are up and running on the new server without a problem.

We can’t be more delighted that Mat chose VaultPress to protect his recordings of Attack of the Androids.

You can learn more about how VaultPress can protect your site — including its contents, themes, plugins, site settings, and customizations.

Contact us with questions — or make our day, and sign up to protect your site!

Posted in Community, General | Leave a comment

Restore via Carrier Pigeon

Thanks to recent advances in avian logistics, your friends at VaultPress are pleased to offer a brand new automated restore tool.

In addition to restoring over FTP and SSH, and restoring to an alternate site, you can now restore your site using our team of carrier pigeons.


You’ll be pleased to know that we’re offering our standard pigeon restore service at no extra cost!

Getting started is easy. First, select your backup. Then, pick your pigeon, and provide us with your datacenter’s physical address.


Our technically proficient pigeons will fly to your datacenter, and restore your site posthaste.

As our carrier pigeons gain experience, and build whatever relevant muscles that pigeons have, we hope to offer a premium option in the future.

As always, please drop us a line if you have any questions! We’re always happy to help.

Posted in General | 2 Comments

Five Ways to Secure Your WordPress Plugins

Plugins allow us to easily modify, customize, and enhance the already amazing WordPress platform. They also allow us a way to share enhancements with those who aren’t able to write their own code. With this freedom and flexibility, it is our responsibility as developers to maintain the same level of care and security in our plugins that everyone expects of the WordPress platform.

I’d like to run through some basic security practices you should include in your plugin where necessary. This information is not just important for developers to know but can be invaluable to non-developers wanting to review plugins before installing and activating them on their sites.

Prevent direct access to PHP files

When WordPress loads it looks for all currently active plugins and loads the appropriate file from each active plugin’s directory. Because these PHP files are most likely located within the web server’s document root (ex: /srv/www/ with being the root directory), anyone can access them from a web browser or other program by going to This is bad.

We must account for the possibility that attackers may exploit this to harm our user’s website or their hosting provider’s server. Preventing this is very easy and should be the absolute first thing you add to the top of your PHP files — before any other code is executed.

We want to prevent public access to this file but still allow WordPress to load the file internally. The most common solution is to check for the existance of the ABSPATH constant defined by WordPress when your site is loaded. If the constant exists, then WordPress is requesting access to load this file. If the constant does not exist, someone is trying to directly access this file and we want to stop them immediately.

<?php defined( 'ABSPATH' ) or die();

Conduct capability checks

WordPress has six pre-defined roles, which give the site owner the ability to control what logged-in users can and cannot do within the site. These roles are: Super Admin, Administrator, Editor, Author, Contributor, and Subscriber. We need to make sure our plugin allows the site owner to retain this control.

WordPress provides us a handy little function to check whether the currently logged-in user has a specific role or capability: current_user_can().

if ( current_user_can( 'edit_users' ) ) {
    // The current user can edit other user's information

In the above example we check whether the currently logged-in user can modify other users’ information on the site before allowing the ability.

Guard against SQL Injections

If your plugin interacts with the database at all you must escape your SQL queries before the SQL query is executed to prevent SQL Injection attacks. SQL Injection is a very simple exploit attackers use to alter an existing SQL command to expose or override data, and could even be used to execute dangerous system level commands on the web host. Escaping your SQL queries is the solution but it’s very often overlooked by developers.

Here’s an example of code which is susceptible to SQL Injection:

$unsafe_variable = $_POST['comment'];
$wpdb->query( "INSERT INTO wp_comments (comment_content) VALUES ('$unsafe_variable')" );

Why is this bad? We are trusting the content of $_POST['comment'] regardless of what it actually contains! If you see this in a plugin you’ve installed, you are at risk of SQL Injection. Deactivate the plugin and contact the developer regarding this security risk. WordPress provides the $wpdb->prepare() function which allows us to easily escape our SQL queries. Here’s how the code above would look using $wpdb->prepare():

$sql = $wpdb->prepare(
    "INSERT INTO wp_comments (comment_content) VALUES (%s)",
$wpdb->query( $sql );

This code would be protected against SQL Injection. You can read more about protecting queries against SQL Injection attacks on the WordPress Codex.

Prevent Cross-site Scripting (XSS)

Cross-site Scripting is another form of injection attack. It occurs when an attacker is capable of injecting code into the output of a web page which is then executed by the visitor’s web browser. What we learned about SQL Injection is that it’s important to escape data before we save it to our database servers. However, some data — which is escaped and safe to save on our servers — can still be valid HTML, CSS, or JavaScript which could be unsafe to output to our visitor’s browser.

Now we need to sanitize any data we obtain from a user’s input before we output the data. If we don’t, that HTML, CSS, or JavaScript can alter our website and cause problems for our visitors. As you’ve probably guessed, WordPress provides several functions to make this easy.

Say we want to generate a link from data our user has input. Let’s make the text of that link the user’s name and have it point to their website’s url.

What you don’t want to do:

<a href="<?php echo $user_url; ?>"><?php echo $user_name; ?></a>

This is what you want to do:

<a href="<?php echo esc_url( $user_url ); ?>"><?php echo esc_html( $user_name ); ?></a>

Familiarize yourself with the sanitation functions WordPress provides and use them where appropriate.

Prevent Cross-site Request Forgery (CSRF)

Cross-site Request Forgery is an attack that tricks a user into submitting a malicious request. This can happen when a user is logged into a website and clicks a seemingly harmless link (which could have been injected via XSS). This link could cause the user to intentionally make a change to their account (they have authenticated access), and in doing so, they give another person access to it. This is just a single example but CSRF is a common and serious exploit we need to prevent.

To prevent a CSRF attack we need to ensure that an action is actually being performed by the authenticated user rather than an attacker. What we need is some sort of unique identifier which we can verify for a request. We will use a nonce (number used once) as this is a unique identifier.

WordPress provides us with a few functions to use nonces in our plugin. You can add a nonce token to a url using wp_nonce_url() and you can add one to a form using wp_nonce_field(). Anytime a user needs to make an authenticated request, whether by clicking a url or submitting a form, you need to generate a nonce for it. When you use the nonce functions provided by WordPress, a token will be generated on the server side. We will then verify the token’s existence in our plugin before executing the authenticated request.

Here’s a simple example of how to add a nonce to a form:

<form action="/submit-comment/" method="post">
    <input type="text" name="comment">
    <input type="submit">
    <?php wp_nonce_field( 'submit_comment' ); ?>

When a user fills out this form, the data is sent to the server along with the generated token. We then need to verify this request with the token:

$nonce = $_REQUEST['_wpnonce'];
if ( ! wp_verify_nonce( $nonce, 'submit_comment' ) ) {
    // nonce is invalid!

If the nonce is invalid we will halt execution of this malicious request. Why does this work? The nonce token is generated by the server, unique to each user, and is unkown to the attacker. This simple token prevents an attacker from forging a request.

In Closing

We’ve gone through a handful of ways plugins can be exploited by a hacker, but with each exploit WordPress provides a simple solution. Writing plugins for WordPress gives us so much freedom and flexibility on the platform and with this ability comes a responsibility to the community; a responsibility to develop secure plugins that the community can trust and use on their websites. And by doing so, we are making the web a better place.

Posted in Security | Tagged , , | 1 Comment