WP Super Cache is a fast caching plugin for WordPress. It will help your site run faster and serve more traffic.
This is a security and bugfix release.
- Some servers display a directory index when no index.html is found in a directory. That may reveal the filenames of cache files.
- There were issues in the settings page that might allow an attacker to browse or delete files named index.html.
- PHP Object Injection could occur if an attacker managed to inject malicious code into the legacy cache meta files.
When you upgrade, your “legacy cache” files for logged in users will be deleted. This may have an impact on your site:
- If your site is slow at generating new pages.
- If you have many known users (logged in users or people who comment).
Your site will suddenly have to generate new cache files for all visiting known users.
Relying on caching like this is not recommended for these types of users as it’s very inefficient. Each user has a separate cache file that must be checked whenever the plugin does administration work like cleaning up stale cache files.
If most of your traffic is anonymous users who don’t comment you don’t need to worry about this.
If a server is configured to show directory listings it will show files and directories in the cache directory to visitors who access those directories directly through their browser. This might reveal private posts, and in the case where legacy caching is enabled for known users the login cookie was stored in “.meta” files that could be downloaded.
Files named “index.html” were added to the main cache directories to stop remote users viewing the contents of the cache directories. Unfortunately it’s not possible to add empty index.html files to the supercache directories because those files could be served by accident to legitimate visitors of the site. However, the plugin will also add a directive that disables directory listings to the file cache/.htaccess. You can now also change the location of the cache directory on the Advanced Settings page of the plugin. If you can’t disable directory indexing on your server and you have private posts you should change this location and use PHP mode to serve cache files.
If a directory index is found in the cache directory it will show a warning like this to administrators:
Clicking the logout link will log everyone out, except the user who clicks it, but it guarantees that the login cookies are updated, just in case someone has copied the cookie from an old meta file.
Directory Traversal and File Deletion
User input in the settings page wasn’t properly sanitised. The code that sanitised directory paths when deleting cache files wasn’t secure and might allow an attacker to view or delete files named index.html. Deletes are protected by a nonce, limiting the useful lifetime of the URL however.
PHP Object Injection
The plugin used serialize and unserialize to store data in “legacy cache” meta files. This might be used to perform a PHP object injection attack. Serialised data is now stored as JSON data.
The format of legacy cached files has changed. The files in the meta directory no longer have a .meta extension. They are .php files now and each file has a “die()” command to stop anyone loading them.
The data stored in those files is now stored as JSON serialised data. The login cookie is an MD5 hash now as well.
When you upgrade the plugin your existing legacy cache files will be deleted and regenerated as visitors use your site.
Apart from those security fixes there have been a number of enhancements and bugfixes:
- Disabling the plugin no longer deletes the configuration file. Uninstalling will do that however.
- Enhancement: Only preload public post types. Props webaware.
- It’s now possible to deactivate the plugin without visiting the settings page.
- Fixed the cache rebuild system. Rebuild files were deleted immediately but now survive up to 10 seconds longer than the request that generate them.
- Minor optimisations: prune_super_cache() exits immediately if the file doesn’t exist.
- The output of wp_cache_get_cookies_values() is now cached per visit.
- Added PHP pid to the debug log to aid debugging.
- Various small bug fixes.
- Fixed reset of expiry time and GC settings when updating advanced settings.
- Removed CacheMeta class to avoid APC errors. It’s not used any more.
- Fixed reset of advanced settings when using “easy” settings page.
This release wouldn’t be possible without the help of Brandon Kraft, Dane Odekirk, Ben Bidner, Jouko Pynnönen and Scrutinizer. Thank you all!