Skip to main content

CVE-2025-5340: Music Player for Elementor XSS Vulnerability

CVE-2025-5340 is a stored XSS flaw in Music Player for Elementor plugin for WordPress that lets authenticated attackers inject malicious scripts. This article covers the technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-5340 Overview

CVE-2025-5340 is a Stored Cross-Site Scripting (XSS) vulnerability in the Music Player for Elementor plugin for WordPress. The flaw affects all versions up to and including 2.4.6. It resides in the handling of the album_buy_url parameter, which lacks sufficient input sanitization and output escaping.

Authenticated users with Contributor-level access or higher can inject arbitrary JavaScript into pages rendered by the plugin. The injected scripts execute in the browser of any visitor who accesses the affected page. The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Authenticated Contributor-level attackers can persist JavaScript in WordPress pages, enabling session theft, admin account takeover, or redirection of site visitors to malicious infrastructure.

Affected Products

  • Music Player for Elementor plugin for WordPress — all versions up to and including 2.4.6
  • WordPress sites running the plugin with Contributor-level or higher user registration
  • Sites relying on the vulnerable slide-music-player-free.php widget

Discovery Timeline

  • 2025-06-03 - CVE-2025-5340 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-5340

Vulnerability Analysis

The Music Player for Elementor plugin exposes a widget that accepts an album_buy_url parameter intended to hold a purchase link for an album. The plugin fails to sanitize the input on write and does not escape the value on output. This allows attackers to store arbitrary HTML and JavaScript payloads in the WordPress database.

When a visitor loads a page containing the affected widget, the browser parses the malicious payload as executable script within the site origin. Because the payload is stored server-side, exploitation is persistent and affects every subsequent viewer. Attackers with Contributor privileges — a role commonly granted for guest posts — can leverage the flaw to escalate access when an administrator previews or reviews the content.

The vulnerable code path resides in the plugin file slide-music-player-free.php. The fix landed in WordPress Changeset #3304812.

Root Cause

The root cause is missing input sanitization and missing output escaping around the album_buy_url widget attribute. The plugin does not apply WordPress escaping helpers such as esc_url() or esc_attr() before rendering the value into HTML attributes. Any string a Contributor supplies is written back into the page verbatim.

Attack Vector

The attack requires network access to the WordPress admin interface and an authenticated account with Contributor role or above. The attacker edits a page or post containing the Music Player for Elementor widget and injects a payload into the album_buy_url field. When any user views the rendered page, the payload executes in the browser under the site's origin. The scope change indicated by the CVSS vector reflects impact on visitors beyond the attacker's own privilege boundary.

Refer to the Wordfence Vulnerability Details for the technical writeup.

// No verified proof-of-concept code is published for CVE-2025-5340.
// The vulnerability is triggered by supplying a crafted string containing
// HTML/JavaScript in the album_buy_url widget attribute, which is then
// rendered without escaping into the resulting page markup.

Detection Methods for CVE-2025-5340

Indicators of Compromise

  • Widget attributes or post meta containing <script>, javascript:, or on*= handlers stored against the album_buy_url field
  • Unexpected outbound requests from visitor browsers to attacker-controlled domains after loading pages that use the Music Player for Elementor widget
  • New administrator accounts or modified user roles following Contributor activity on posts using the affected plugin

Detection Strategies

  • Query the WordPress database (wp_postmeta, wp_posts) for widget configurations containing script tags, event handlers, or javascript: URIs in Elementor data structures
  • Monitor Elementor page edits by Contributor-level accounts and review the JSON payload for markup in the album_buy_url field
  • Deploy a Web Application Firewall (WAF) rule that flags XSS payloads submitted to WordPress REST or admin-ajax endpoints handling Elementor widget data

Monitoring Recommendations

  • Enable WordPress audit logging to record post edits, revisions, and user role changes for correlation with suspicious content
  • Track outbound Content Security Policy (CSP) violation reports to detect script execution originating from unexpected sources
  • Alert on privilege escalation events and session cookie access patterns that follow admin previews of Contributor-authored content

How to Mitigate CVE-2025-5340

Immediate Actions Required

  • Update the Music Player for Elementor plugin to a version newer than 2.4.6 that includes the fix from Changeset #3304812
  • Audit all pages and posts using the plugin's widgets for existing malicious payloads in the album_buy_url field and remove them
  • Review Contributor and Author accounts for legitimacy and rotate credentials for any suspicious users

Patch Information

The vendor addressed the flaw in the plugin release following version 2.4.6. Site administrators should install the latest release from the WordPress plugin repository. Verify the running version through the WordPress admin plugins panel after upgrading.

Workarounds

  • Temporarily deactivate the Music Player for Elementor plugin until the update is applied
  • Restrict Contributor and Author role assignment to trusted users, and require admin review before publishing content that uses the plugin's widgets
  • Deploy a WAF ruleset that blocks HTML tags and JavaScript URIs submitted to Elementor widget parameters
bash
# Update the plugin using WP-CLI
wp plugin update music-player-for-elementor

# Verify the installed version is greater than 2.4.6
wp plugin get music-player-for-elementor --field=version

# Temporarily deactivate the plugin if patching is delayed
wp plugin deactivate music-player-for-elementor

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.