WordPress Ninja Forms Plugin Unauthenticated File Upload — CVE-2026-0740
by murrez · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-0740
- Category
- web
- Affected product
- WordPress "Ninja Forms" plugin — file upload field/module
- Affected versions
- Vulnerable Ninja Forms versions exposing nf_fu_get_new_nonce / nf_fu_upload AJAX actions without adequate restriction (exact version range not specified in source)
- Disclosed
- 2026-07-05
- Patch status
- unpatched
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-04 |
| Author / Researcher | murrez |
| CVE / Advisory | CVE-2026-0740 |
| Category | web |
| Severity | High |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | wordpress, ninja-forms, file-upload, webshell, admin-ajax, plugin-vulnerability, cwe-434 |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | WordPress “Ninja Forms” plugin — file upload field/module |
| Versions Affected | Vulnerable Ninja Forms versions exposing nf_fu_get_new_nonce / nf_fu_upload AJAX actions without adequate restriction (exact version range not specified in source) |
| Language / Platform | Python 3 (requests) targeting WordPress wp-admin/admin-ajax.php |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
Ninja Forms exposes a file-upload field feature reachable via WordPress’s admin-ajax.php endpoint. The PoC script first requests a fresh nonce through the nf_fu_get_new_nonce action, then uses that nonce to submit a file via the nf_fu_upload action. Because the upload handler does not adequately restrict the uploaded file type/extension, an attacker can upload a PHP web shell disguised as a form attachment, which the plugin stores at a predictable, web-accessible path. The script iterates over a list of candidate targets, attempts the nonce-then-upload sequence against each, and records any resulting shell URLs for later access.
Vulnerability Details
Root Cause
Insufficient validation of uploaded file type/extension in the Ninja Forms file-upload AJAX handler (nf_fu_upload), allowing arbitrary file (including PHP) uploads to a web-accessible directory (CWE-434: Unrestricted Upload of File with Dangerous Type).
Attack Vector
- Send a POST request to
wp-admin/admin-ajax.phpwithaction=nf_fu_get_new_nonce(plusform_id/field_id) to obtain a valid upload nonce. - Submit a multipart POST with
action=nf_fu_upload, the retrieved nonce, and a PHP payload disguised as the configuredSHELL_NAME. - If the upload succeeds, the plugin returns/stores a path from which the uploaded file (PHP web shell) can be directly requested.
- Access the resulting URL to execute arbitrary PHP code on the server.
Impact
Unauthenticated arbitrary file upload leading to remote code execution on the underlying WordPress server via a planted PHP web shell.
Environment / Lab Setup
Target: WordPress site running a vulnerable version of the Ninja Forms plugin with an exposed file-upload form
Attacker: Python 3 with requests + urllib3 (pip install requests urllib3)
Proof of Concept
PoC Script
See
ninja.pyin this folder. (Note: the upstream repository’slist.txt, containing ~1,900 real-world candidate target URLs, was intentionally excluded from this mirror as it is scan/target data rather than PoC source.)
| |
The script reads target site URLs from a local list.txt (one per line), requests a valid Ninja Forms upload nonce for each, attempts to upload a small PHP web shell (FORM_ID/FIELD_ID/SHELL_NAME/SHELL_CONTENT are configurable constants at the top of the script), and appends any successfully-uploaded shell URLs to shell.txt, printing a final success count.
Detection & Indicators of Compromise
Signs of compromise:
- Unexpected
.phpfiles present in the Ninja Forms upload directory (typically underwp-content/uploads/) - Outbound requests to unfamiliar PHP file paths matching a web shell interface
- Spikes of automated admin-ajax.php requests from a single source IP across many form/field ID combinations
Remediation
| Action | Detail |
|---|---|
| Primary fix | No vendor patch confirmed as of 2026-07-05 — update Ninja Forms to the latest version and monitor plugin changelog for a fix addressing upload validation |
| Interim mitigation | Disable or restrict the file-upload form field, enforce strict file-extension/MIME allowlisting at the web server level, and disable PHP execution in uploads directories |
References
Notes
Mirrored from https://github.com/murrez/CVE-2026-0740 on 2026-07-05.
| |