Atomic Edge analysis of CVE-2026-4347:
The MW WP Form plugin for WordPress versions up to and including 5.1.0 contains an unauthenticated arbitrary file move vulnerability. This flaw exists in the file handling mechanism when a form with a file upload field is configured with the ‘Saving inquiry data in database’ option enabled. Attackers can exploit this to move arbitrary files on the server, potentially leading to remote code execution.
Atomic Edge research identifies the root cause in the `generate_user_filepath` function within `/mw-wp-form/classes/models/class.directory.php`. The vulnerable code constructs a file path by joining a user-controlled `$filename` parameter with a base directory using `path_join`. Prior to the patch, the function performed insufficient validation on the `$filename` parameter. It only checked for directory traversal sequences (`../`) after constructing the full path, which could be bypassed. The `move_temp_file_to_upload_dir` function then uses this insecure path generation to move files.
The exploitation method involves an unauthenticated attacker submitting a crafted request to the plugin’s file upload handler. The attacker supplies a `filename` parameter containing a path traversal payload targeting a sensitive file, such as `../../../wp-config.php`. When the plugin processes the upload, it moves the temporary uploaded file to the attacker-specified location, overwriting the target file. This attack requires the form to have a file upload field and for data saving to be enabled, which triggers the vulnerable `move_temp_file_to_upload_dir` function.
The patch in version 5.1.1 adds multiple layers of validation. It normalizes the `$filename` using `wp_normalize_path`. The patch then verifies that the normalized filename equals its basename, ensuring no directory components are present. It also checks for null bytes. Crucially, the patch normalizes the final `$filepath` and the `$user_file_dir`, then uses `strpos` to confirm the final path remains within the intended directory. This path containment check, performed before the traversal sequence check, prevents directory escape regardless of input encoding or separators.
Successful exploitation allows an attacker to move and overwrite arbitrary files on the web server. The primary impact is remote code execution, achieved by moving a malicious file to replace a critical PHP file like `wp-config.php` or a theme/plugin file. This grants the attacker full control of the WordPress site. The vulnerability can also lead to data loss, site defacement, or denial of service by overwriting essential configuration or system files.

