
Attackers are exploiting a critical flaw in the File Uploads add-on for the Ninja Forms WordPress plugin to upload PHP files and take over sites. The bug, CVE-2026-0740, needs no login and is a textbook case of validating the wrong filename. A fix has been available since March, so any site still running version 3.3.26 or earlier of the add-on should be treated as at risk.
What happened
Researcher Sélim Lanouar (whattheslime) reported the vulnerability through Wordfence's bug bounty programme on 8 January 2026 and received a $2,145 bounty. Wordfence validated it, notified the vendor the same day and shipped a firewall rule to its paying customers. A partial fix followed on 10 February, and the complete fix arrived in version 3.3.27 on 19 March. Wordfence published details on 6 April, and exploitation began almost immediately.
BleepingComputer reported on 7 April that Wordfence had blocked more than 3,600 attacks in the previous 24 hours. In a later update, Wordfence said its firewall had blocked over 118,600 exploit attempts, with mass exploitation between 9 and 13 April and one IP address responsible for more than 53,000 requests. Attackers uploaded PHP webshells disguised as PDFs or images, minimal file uploaders, and malicious .htaccess files that make non-PHP files executable on Apache.
Who is affected
- WordPress sites running the Ninja Forms File Uploads premium add-on, version 3.3.26 or earlier.
- Fixed in 3.3.27. Version 3.3.25 contained only a partial fix.
- Wordfence estimates about 50,000 active installations; BleepingComputer cites 90,000 add-on customers. The free core Ninja Forms plugin is not the vulnerable component.
What it means for developers and engineering teams
The vulnerable code is the NF_FU_AJAX_Controllers_Uploads::handle_upload function. It checked the file type of the uploaded file's original name but did not validate or sanitise the destination filename it wrote to disk. An attacker could therefore submit an allowed file type while controlling the destination name, including ../ path traversal sequences and a .php extension, and write executable code anywhere the web server user can write, including the web root. Requesting that file then runs it: unauthenticated remote code execution, rated CVSS 9.8.
The lesson applies to any upload handler in any stack:
- Never let the client choose the stored filename. Generate a random name server-side and keep the original only as metadata.
- Validate the final path, after resolving it, is inside the intended directory.
- Store uploads outside the web root or in object storage, and serve them through a handler that sets a safe
Content-TypeandContent-Disposition. - Disable script execution in upload directories at the web server level, so a mistake does not become code execution.
A minimal safe pattern in PHP looks like this:
$allowed = ['pdf', 'png', 'jpg'];
$ext = strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION));
if (!in_array($ext, $allowed, true)) { http_response_code(400); exit; }
$name = bin2hex(random_bytes(16)) . '.' . $ext; // server-chosen name
$dest = '/srv/app-uploads/' . $name; // outside the web root
move_uploaded_file($_FILES['file']['tmp_name'], $dest);
The client never influences the path, the extension comes from an allow-list, and the file lands where the web server will not execute it. Content sniffing (checking magic bytes with finfo) is a useful extra layer but not a substitute for controlling the name and location. In WordPress specifically, use wp_handle_upload() with an explicit mimes allow-list rather than writing files yourself.
The disclosure timeline also matters for site owners. The patch was out for almost three weeks before details went public, and attacks started the same day. Sites that apply premium plugin updates promptly were safe; sites that update quarterly were not.
What to do now
- Update the add-on to 3.3.27 or later. With WP-CLI:
(Check the exact slug in your plugin list.)wp plugin list | grep -i ninja wp plugin update ninja-forms-uploads - Look for dropped files in the web root and uploads directory:
find wp-content/uploads -type f \( -name "*.php" -o -name "*.phtml" -o -name ".htaccess" \) -newermt 2026-04-01 - Search access logs for upload requests:
grep "admin-ajax.php" access.log | grep "nf_fu_upload" - Block PHP execution in uploads. On Nginx, add
location ~* /wp-content/uploads/.*\.php$ { deny all; }; on Apache, disable PHP handling for that directory. - If you find a webshell, treat the site as compromised: restore from a clean backup, rotate database and admin credentials and WordPress salts, and review admin users.