On April 25, 2023, our Wordfence Threat Intelligence team identified and began the responsible disclosure process for a stored Cross-Site Scripting (XSS) vulnerability in W3 Eden’s Download Manager plugin, which is actively installed on more than 100,000 WordPress websites, making it one of the most popular download management plugins. The vulnerability enables threat actors with contributor-level permissions or higher to inject malicious web scripts into pages using the plugin’s shortcode.
All Wordfence Premium, Wordfence Care, and Wordfence Response customers, as well as those still using the free version of our plugin, are protected against any exploits targeting this vulnerability by the Wordfence firewall’s built-in Cross-Site Scripting protection.
We contacted W3 Eden on April 25, 2023, and promptly received a response. After providing full disclosure details, the developer released a patch on May 1, 2023. We would like to commend the W3 Eden development team for their prompt response and timely patch.
We urge users to update their sites with the latest patched version of Download Manager, version 3.2.71 at the time of this writing, as soon as possible.
Vulnerability Summary from Wordfence Intelligence
Affected Plugin: Download Manager
Plugin Slug: download-manager
Affected Versions: <= 3.2.70
CVE ID: CVE-2023-2305
CVSS Score: 6.4 (Medium)
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Researcher/s: Lana Codes
Fully Patched Version: 3.2.71
The Download Manager plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the ‘wpdm_members’, ‘wpdm_login_form’, ‘wpdm_reg_form’ shortcodes in versions up to, and including, 3.2.70 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers with contributor-level and above permissions to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
Technical Analysis
Download Manager is a plugin designed to allow WordPress users to manage, track and control file downloads. It provides a shortcode ([wpdm_members]) that lists the authors and the number of files they have added when added to a WordPress page. However, insecure implementation of the plugin’s shortcode functionality allows for the injection of arbitrary web scripts into these pages. Examining the code reveals that the members method in the User class did not adequately sanitize the user-supplied ‘sid’ input, and then loads the members.php view file, where it also did not adequately escape ‘sid’ output. This makes it possible to inject attribute-based Cross-Site Scripting payloads via the ‘sid’ attribute.
class User
{
function members($params = array())
{
$sid = isset($params[‘sid’]) ? $params[‘sid’] : ”;
update_post_meta(get_the_ID(), ‘__wpdm_users_params’ . $sid, $params);
ob_start();
include Template::locate(“members.php”, __DIR__.’/views’);
return ob_get_clean();
}
The members method in the User class
<div class=”w3eden” id=”wpdm-authors<?php echo isset($params[‘sid’])?”-{$params[‘sid’]}”:””; ?>”>
<?php $this->listAuthors($params); ?>
</div>
The members.php view file
There are two other shortcodes, a login form shortcode ([wpdm_login_form]) and a registration form shortcode ([wpdm_reg_form]), that add forms to a WordPress site. However, the insecure implementation of these two shortcode functions, similar to the previous example, also allows arbitrary web scripts to be inserted into these pages. Examining the code reveals that the functions of both forms do not adequately sanitize the user-supplied ‘logo’ input, and in the view files these ‘logo’ outputs are not adequately escaped.
class Login
{
function form($params = array())
{
global $current_user;
if (!isset($params) || !is_array($params)) $params = array();
if (isset($params) && is_array($params))
extract($params);
The form method in the Login class
<div class=”w3eden”>
<div id=”wpdmlogin” <?php if(wpdm_query_var(‘action’) == ‘lostpassword’) echo ‘class=”lostpass”‘; ?>>
<?php if(isset($params[‘logo’]) && $params[‘logo’] != ” && !is_user_logged_in()){ ?>
<div class=”text-center wpdmlogin-logo”>
<a href=”<?php echo home_url(‘/’); ?>”><img alt=”Logo” src=”<?php echo $params[‘logo’];?>” /></a>
</div>
<?php } ?>
The login-form.php view file
class Register
{
function form($params = array())
{
if (!get_option(‘users_can_register’)) return WPDM__Messages::warning(__(“User registration is disabled”, “download-manager”), -1);
if (!isset($params) || !is_array($params)) $params = array();
…
if (!isset($params[‘logo’])) $params[‘logo’] = get_site_icon_url();
The form method in the Register class
<div class=”w3eden”>
<div class=’w3eden’ id=’wpdmreg’>
<?php
if(get_option(‘users_can_register’)){
//LOGO
if(isset($params[‘logo’]) && $params[‘logo’] != ” && !isset($nologo)){ ?>
<div class=”text-center wpdmlogin-logo”>
<a href=”<?php echo esc_url(home_url(‘/’)); ?>”><img src=”<?php echo $params[‘logo’];?>” /></a>
</div>
<?php } ?>
The reg-form.php view file
These make it possible for threat actors to carry out stored XSS attacks. Once a script is injected into a page or post, it will execute each time a user accesses the affected page. While this vulnerability does require that a trusted contributor account is compromised, or a user be able to register as a contributor, successful threat actors could steal sensitive information, manipulate site content, inject administrative users, edit files, or redirect users to malicious websites which are all severe consequences.
Disclosure Timeline
April 25, 2023 – Wordfence Threat Intelligence team discovers the stored XSS vulnerability in Download Manager and initiates responsible disclosure.
April 27, 2023 – We get in touch with the development team at W3 Eden and send full disclosure details.
May 1, 2023 – The fully patched version, 3.2.71, is released.
May 3, 2023 – The vendor notified Wordfence that they released the patch.
May 3, 2023 – Wordfence confirms the fix addresses the vulnerability.
Conclusion
In this blog post, we have detailed a stored XSS vulnerability within the Download Manager plugin affecting versions 3.2.70 and earlier. This vulnerability allows authenticated threat actors with contributor-level permissions or higher to inject malicious web scripts into pages that execute when a user accesses an affected page. The vulnerability has been fully addressed in version 3.2.71 of the plugin.
We encourage WordPress users to verify that their sites are updated to the latest patched version of Download Manager.
All Wordfence users, including those running Wordfence Premium, Wordfence Care, and Wordfence Response, as well as sites still running the free version of Wordfence, are fully protected against this vulnerability.
If you know someone who uses this plugin on their site, we recommend sharing this advisory with them to ensure their site remains secure, as this vulnerability poses a significant risk.
For security researchers looking to disclose vulnerabilities responsibly and obtain a CVE ID, you can submit your findings to Wordfence Intelligence and potentially earn a spot on our leaderboard.
The post W3 Eden Addresses Authenticated Stored XSS Vulnerability in Download Manager WordPress Plugin appeared first on Wordfence.