The MW WP Form plugin for WordPress is vulnerable to Arbitrary File Move/Read in all versions up to and including 5.1.1. This is due to insufficient validation of the $name parameter (upload field key) passed to the generateuserfiledirpath() function, which uses WordPress's pathjoin() — a function that returns absolute paths unchanged, discarding the intended base directory. The attacker-controlled key is injected via the mwfuploadfiles[] POST parameter, which is loaded into the plugin's Data model via setrequestvaliables(). During form processing, regenerateuploadfilekeys() iterates over these keys and calls generateuserfilepath() with the attacker-supplied key as the $name argument — the key survives validation because the targeted file (e.g., wp-config.php) genuinely exists at the absolute path. The getattachments() method then re-reads the same surviving keys and passes the resolved file path to movetempfiletoupload_dir(), which calls rename() to move the file into the uploads folder. This makes it possible for unauthenticated attackers to move arbitrary files on the server, which can easily lead to remote code execution when the right file is moved (such as wp-config.php). The vulnerability is only exploitable if a file upload field is added to the form and the “Saving inquiry data in database” option is enabled.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/5xxx/CVE-2026-5436.json",
"cna_assigner": "Wordfence",
"cwe_ids": [
"CWE-22"
]
}