CVE-2025-27358
Executive Summary
CVE-2025-27358 is a stored cross-site scripting (XSS) vulnerability in the N-Media Frontend File Manager WordPress plugin (slug: nmedia-user-file-uploader). The plugin fails to properly neutralize script-related HTML tags in user-submitted file uploads, allowing authenticated attackers with contributor-level access or higher to inject arbitrary JavaScript code. This code executes in the context of any administrator viewing the uploaded file’s metadata or preview page. The vulnerability affects all versions up to and including 23.6. No official patch has been released as of this analysis, and no public exploit code exists. The CVSS score of 4.6 reflects a medium severity due to the requirement for authenticated access and user interaction.
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 resides in a WordPress plugin distributed via the official WordPress plugin repository. Users who installed the plugin directly from the WordPress dashboard or via ZIP upload are affected. No known supply chain compromise of the plugin’s source code has been reported, but the lack of a patch increases the risk of malicious actors forking or distributing modified versions.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – An attacker needs contributor-level access or higher.
- User Interaction (UI): Required (R) – An administrator must view the malicious file’s metadata.
- Scope (S): Changed (C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): None (N) – No direct impact on availability.
Threat Level: Medium. The requirement for authenticated access and user interaction reduces the likelihood of widespread exploitation, but the lack of a patch makes it a persistent risk for unmaintained sites.
Deep Dive & Mechanics
The vulnerability stems from improper sanitization of HTML tags in the file upload functionality. When a user uploads a file, the plugin processes the file name and description fields without stripping script-related HTML tags (e.g., <script>, <img onerror>, <svg onload>). An attacker can craft a file name or description containing malicious JavaScript, which is then stored in the database and rendered unsanitized in the WordPress admin panel or frontend file listing.
The injection point is likely in the nmedia_user_file_uploader shortcode or the admin file management page. The plugin uses PHP functions like sanitize_text_field() or esc_html() inconsistently, allowing HTML tags to pass through. The stored XSS payload executes when an administrator views the file list or clicks on the file name, leading to session hijacking, admin account creation, or redirection to malicious sites.
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical fix based on common WordPress security practices.
Vulnerable Code (hypothetical):
// In nmedia-user-file-uploader.php
$file_name = $_POST['file_name'];
// No sanitization
update_post_meta($file_id, 'nmedia_file_name', $file_name);
Patched Code (hypothetical):
// Patched version
$file_name = sanitize_text_field($_POST['file_name']);
$file_name = wp_strip_all_tags($file_name);
update_post_meta($file_id, 'nmedia_file_name', $file_name);
The patched version uses wp_strip_all_tags() to remove all HTML tags, preventing script injection. Additionally, output should be escaped with esc_html() when rendering.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress site with Frontend File Manager plugin <= 23.6
- Contributor-level account or higher
Steps:
- Log in as a contributor.
- Navigate to the file upload page (e.g.,
/wp-admin/admin.php?page=nmedia-files). - Upload a file with a malicious file name:
test<script>alert(document.cookie)</script>.txt - Alternatively, use a description field:
<img src=x onerror=alert(1)> - Wait for an administrator to view the file list or click on the file name.
- The XSS payload executes in the admin’s browser.
Proof-of-Concept (No public exploit available):
# Using curl to upload a file with malicious name
curl -X POST -F "file=@test.txt" -F "file_name=test<script>alert(1)</script>.txt" -F "action=upload" -b "cookies.txt" http://target.com/wp-admin/admin-ajax.php
Blue Team
Detection:
- Monitor for file uploads containing HTML tags in file names or descriptions.
- Look for unusual JavaScript execution in admin sessions.
- Use WAF rules to block file names containing
<script>or event handlers.
Hunting:
- Search WordPress database for posts with meta keys
nmedia_file_nameornmedia_file_descriptioncontaining HTML tags. - Review server logs for POST requests to
admin-ajax.phpwith suspiciousfile_nameparameters.
Indicators of Compromise (IOCs)
- File Names:
*<script>*,*<img onerror*,*<svg onload* - Database Entries:
wp_postmetawithmeta_key = 'nmedia_file_name'andmeta_valuecontaining HTML tags. - Network Traffic: POST requests to
/wp-admin/admin-ajax.phpwithaction=uploadand suspiciousfile_nameparameters. - Logs: PHP error logs showing
unserialize()failures or unexpected HTML output.
Detection Engineering
YARA Rule
rule CVE_2025_27358_XSS_FileUpload {
meta:
description = "Detects malicious file names or descriptions targeting CVE-2025-27358"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-27358"
strings:
$xss1 = /<script[^>]*>/i
$xss2 = /<img[^>]+onerror/i
$xss3 = /<svg[^>]+onload/i
$xss4 = /onmouseover/i
condition:
any of ($xss*)
}
Sigma Rule
title: CVE-2025-27358 - Stored XSS via File Upload
id: 8a7b3c2d-1e5f-4a6b-9c8d-7e2f1a3b4c5d
status: experimental
description: Detects file uploads with HTML tags in file names or descriptions
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'admin-ajax.php'
cs-uri-query|contains: 'action=upload'
cs-uri-query|contains|re: '<script|<img onerror|<svg onload'
condition: selection
falsepositives:
- Legitimate file names containing HTML-like strings (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-27358 - Stored XSS via File Upload"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=upload"; http_client_body; pcre:"/<script[^>]*>|<img[^>]+onerror|<svg[^>]+onload/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Frontend File Manager plugin until a patch is available.
- Implement a Web Application Firewall (WAF) rule to block file uploads containing HTML tags.
- Restrict file upload permissions to trusted users only.
Long-term Fix:
- Apply input sanitization using
wp_strip_all_tags()andesc_html()on all file metadata fields. - Use WordPress nonces and capability checks to prevent unauthorized uploads.
- Monitor the plugin’s repository for an official patch.
Workaround:
- Add the following code to the theme’s
functions.phpto sanitize file names:
add_filter('nmedia_file_name', 'wp_strip_all_tags');
add_filter('nmedia_file_description', 'wp_strip_all_tags');
Valters IT
Securing Digital Frontiers
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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.