Web Directory Free Plugin <= 1.7.2: Unauthenticated LFI Exploit (
The Web Directory Free plugin for WordPress up to version 1.7.2 is vulnerable to local file inclusion via the w2dc_isTemplate() function. An unauthenticated attacker can include and execute arbitrary files on the server, potentially leading to full server compromise.
Published on bashoverflow.com
Web Directory Free Plugin is a WordPress plugin designed to help users build and manage directory listings. This plugin offers several features, such as creating custom fields, managing categories, integrating Google Maps, and using templates to display directory content.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the w2dc_isTemplate() function does not properly validate or sanitise user-supplied input before using it to include a file, allowing directory traversal.
Impact
An attacker could read sensitive files on the server, and in severe cases, LFI could lead to full server control.
What the attacker needed
WordPress with vulnerable plugin installed; No authentication required
The fix
The plugin should be updated to the latest version where the vulnerability is patched.
How it was found
- Install and activate the Web Directory Free plugin on a WordPress site.
- Create a post using the [webdirectory-search] shortcode to display a directory listing.
- Send a POST request to /wp-admin/admin-ajax.php with the action parameter set to w2dc_controller_request.
- Observe the server response to see how the action parameter is processed.
- Add a template parameter containing ../ sequences to test for directory traversal.
- Keep appending ../ until the contents of /etc/passwd are displayed, confirming the vulnerability.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Local File Inclusion (LFI) is a flaw where a website lets an attacker trick it into reading or running files that are already on the server, such as system files. Here, a WordPress plugin fails to check a parameter properly, so anyone can ask the server to include files outside the intended folder. This can expose sensitive data or even let an attacker run their own code.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.