Kabron Posted December 24, 2012 Report Posted December 24, 2012 Hi all, From the developers' description [1], W3 Total Cache is: The most complete WordPress performance framework. Recommended by web hosts like: MediaTemple, Host Gator, Page.ly and WP Engine and countless more. Trusted by countless sites like: stevesouders.com, mattcutts.com, mashable.com, smashingmagazine.com, makeuseof.com, yoast.com, kiss925.com, pearsonified.com, lockergnome.com, johnchow.com, ilovetypography.com, webdesignerdepot.com, css-tricks.com and tens of thousands of others. W3 Total Cache improves the user experience of your site by improving your server performance, caching every aspect of your site, reducing the download times and providing transparent content delivery network (CDN) integration. Downloads: 1,388,876 Ratings: 4.6 out of 5 starsUnfortunately, it's frequently incorrectly deployed. When I set it upby going to the Wordpress panel and choosing "add plugin" andselecting the plugin from the Wordpress Plugin Catalog (or whatever),it left two avenues of attack open:1) Directory listings were enabled on the cache directory, which meansanyone could easily recursively download all the database cache keys,and extract ones containing sensitive information, such as passwordhashes. A simple google search of"inurl:wp-content/plugins/w3tc/dbcache" and maybe some other magicreveals this wasn't just an issue for me. As W3 Total Cache alreadyfutzes with the .htaccess file, I see no reason for it not to add"Options -Indexes" to it upon installation. I haven't read any W3documentation, so it's possible this is a known and documentedmisconfiguration, but maybe not.2) Even with directory listings off, cache files are by defaultpublicly downloadable, and the key values / file names of the databasecache items are easily predictable. Again, it seems odd that "denyfrom all" isn't added to the .htaccess file. Maybe it's documentedsomewhere that you should secure your directories, or maybe it isn't;I'm not sure.If I had to categorize these holes, I'd say they're due to"misconfiguration", but I figure it's relevant to write in tofull-disclosure & webappsec because I'm usually not horrible withconfiguring things and I made these mistakes several times withoutrealizing. I'm copying the author on this email, as he may want toinclude a warning message where nieve folks like myself can see it, ordocument these somewhere if they're not already, or at least apply thetwo .htaccess tweaks mentioned above.Anyway I put together a short and simple shell script that workspretty decently against my own various wordpress websites, andexploits the configuration error in point (2) above. Exploiting point(1) can be done with wget & grep and is even more dull than the belowexploit.****************W3 Total FailExploit for point (2):w3-total-fail - Intelligently guesses hash values in order to extract Wordpress password hashes via W3 Total Cache. (Read theentire usage message.)Screencast for point (2):http://git.zx2c4.com/w3-total-fail/plain/screencast.ogv or ****************Merry Christmas.- Jason zx2c4Full Disclosure: Wordpress Remote Exploit - W3 Total Cache Quote