In September 2016, a Cross-Site Scripting (XSS) vulnerability was found in W3 Total Cache. This W3 Total Cache vulnerability affected version 0.9.4.1 and all versions before it.
At the time, the W3 Total Cache developers hadn’t updated their plugin yet, so we suggested the guide below to patch W3TC by hand.
Think your site has been hacked? We remove the malware, close the hole it came through and lock the site down for a flat $249. See malware removal →
How to Guide Securing W3 Total Cache Cross-Site Scripting(XSS) Vulnerability
- Create a backup of W3 Total Cache
- Connect to your site files through your host’s File Manager or an SFTP/FTP client
- Edit file found at /wp-content/plugins/w3-total-cache/inc/options/support/form.php
Replace lines 21, 22 and 23<input type="hidden" name="request_type" value="<?php echo $request_type; ?>" /> <input type="hidden" name="request_id" value="<?php echo $request_id; ?>" /> <input type="hidden" name="payment" value="<?php echo $payment; ?>" />
with
<input type="hidden" name="request_type" value="<?php echo htmlspecialchars($request_type, ENT_QUOTES, 'UTF-8'); ?>" /> <input type="hidden" name="request_id" value="<?php echo htmlspecialchars($request_id, ENT_QUOTES, 'UTF-8'); ?>" /> <input type="hidden" name="payment" value="<?php echo htmlspecialchars($payment, ENT_QUOTES, 'UTF-8'); ?>" />
- Save and close the file
That secured the site until W3TC published an update that fixed this security issue. Today, the right fix is simply to keep W3 Total Cache updated, ideally with plugin auto-updates turned on.
When my sites got hacked and my webhost said, “Sorry, can’t help you!” FixMyWP stepped in to clean out the sites in their trademark meticulous manner–all while keeping the pricing honest and reasonable.
Source: https://github.com/szepeviktor/fix-w3tc/pull/81
Think your site has been hacked?
We remove the malware, close the hole it came through and lock the site down. Flat rate of $249, usually done the same day or within 24 business hours.
