CVE-2024-8735
Executive Summary
CVE-2024-8735 is a Reflected Cross-Site Scripting (XSS) vulnerability in the MailMunch – Grow your Email List WordPress plugin, affecting all versions up to and including 3.1.8. The flaw arises from the insecure use of add_query_arg without proper output escaping on a URL parameter. An unauthenticated attacker can craft a malicious link that, when clicked by a logged-in administrator or editor, executes arbitrary JavaScript in the context of the WordPress admin panel. This can lead to session hijacking, privilege escalation, or defacement. The vulnerability is classified as medium severity (CVSS 6.1) with a low EPSS score (0.0%), indicating low exploitation likelihood at this time, but the lack of a patch makes it a persistent risk for unmaintained sites.
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. No package manager (NPM, PyPI, Go, Ruby) is involved. The risk is primarily to WordPress site owners who have installed the plugin directly from the WordPress dashboard or via manual upload.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed to trigger the XSS.
- User Interaction (UI): Required (R) – Victim must click a crafted link.
- Scope (S): Changed (C) – The injected script can affect resources beyond the vulnerable component (e.g., WordPress admin).
- Confidentiality (C): Low (L) – Limited data exposure (e.g., session tokens).
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium. While the CVSS score is 6.1, the lack of a patch and the plugin’s widespread use in email marketing campaigns elevate the risk for unmaintained sites.
Deep Dive & Mechanics
The vulnerability resides in the plugin’s handling of URL parameters, specifically within a function that constructs redirect URLs using add_query_arg. The add_query_arg function in WordPress is used to append query parameters to a URL. However, the plugin fails to escape the resulting URL before outputting it in an HTML attribute (e.g., href or action). An attacker can inject a malicious JavaScript payload via a crafted query parameter, such as ?page=mailmunch%22%20onmouseover%3D%22alert(1).
When the victim clicks the link, the injected script executes in the context of the WordPress admin dashboard, allowing the attacker to:
- Steal session cookies (if
HttpOnlyflag is missing). - Perform actions on behalf of the victim (e.g., create admin accounts).
- Deface the site or redirect users to malicious domains.
The attack flow:
- Attacker crafts a URL:
https://victim.com/wp-admin/admin.php?page=mailmunch%22%20onmouseover%3D%22alert(1). - Victim (logged-in admin) clicks the link.
- The plugin outputs the unescaped URL, causing the browser to interpret the injected
onmouseoverevent. - The JavaScript payload executes.
Vulnerable vs. Patched Code
Vulnerable Code (<= 3.1.8):
// In a plugin file (e.g., mailmunch-admin.php)
$url = add_query_arg( 'page', 'mailmunch', admin_url( 'admin.php' ) );
echo '<a href="' . $url . '">Settings</a>';
The $url is not escaped, allowing injection via the page parameter.
Patched Code (Hypothetical):
$url = add_query_arg( 'page', 'mailmunch', admin_url( 'admin.php' ) );
echo '<a href="' . esc_url( $url ) . '">Settings</a>';
Using esc_url() ensures the URL is properly encoded, preventing XSS.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with MailMunch plugin <= 3.1.8.
- A victim with admin privileges.
Exploit Steps:
- Identify the vulnerable endpoint:
wp-admin/admin.php?page=mailmunch. - Craft a malicious URL with a JavaScript payload:
https://victim.com/wp-admin/admin.php?page=mailmunch%22%20onmouseover%3D%22alert(document.cookie) - Send the link to the victim via email or social engineering.
- When the victim hovers over the link (or clicks it), the script executes.
Proof-of-Concept (PoC) HTML:
<a href="https://victim.com/wp-admin/admin.php?page=mailmunch%22%20onmouseover%3D%22alert('XSS')">Click me</a>
Blue Team (Detection & Hardening)
Detection:
- Monitor web server logs for requests to
/wp-admin/admin.phpwith suspiciouspageparameters containing HTML/JavaScript characters (e.g.,%22,%3C,%3E). - Use WAF rules to block requests with unescaped HTML in query parameters.
Hardening:
- Disable or remove the MailMunch plugin if not essential.
- Apply a virtual patch via WAF (e.g., ModSecurity rule to block
page=mailmunchwith script tags). - Educate users to avoid clicking suspicious links.
Indicators of Compromise (IOCs)
- URL Pattern:
wp-admin/admin.php?page=mailmunch*containing encoded HTML/JavaScript (e.g.,%22,%3Cscript%3E). - HTTP Referer: Requests to the vulnerable endpoint from external domains.
- Log Entries:
GET /wp-admin/admin.php?page=mailmunch%22%20onmouseover%3D%22...with non-standard user agents. - File Changes: Unexpected modifications to WordPress admin pages or plugin files.
Detection Engineering
YARA Rule
rule CVE_2024_8735_MailMunch_XSS {
meta:
description = "Detects malicious requests targeting CVE-2024-8735 in MailMunch plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-8735"
strings:
$vuln_path = "/wp-admin/admin.php"
$vuln_param = "page=mailmunch"
$xss_payload = /%22|%3C|%3E|on\w+=/
condition:
$vuln_path and $vuln_param and #xss_payload > 0
}
Sigma Rule
title: CVE-2024-8735 MailMunch Reflected XSS Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests with XSS payloads targeting the MailMunch plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '/wp-admin/admin.php'
cs-uri-query|contains: 'page=mailmunch'
cs-uri-query|re: '(%22|%3C|%3E|on\w+=)'
condition: selection
falsepositives:
- Legitimate use of encoded characters in other contexts
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-8735 MailMunch Reflected XSS Attempt";
flow:to_server,established;
content:"/wp-admin/admin.php"; http_uri;
content:"page=mailmunch"; http_uri;
pcre:"/(%22|%3C|%3E|on\w+=)/Ui";
sid:1000001;
rev:1;
reference:cve,2024-8735;
priority:2;
)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and delete the MailMunch plugin from all WordPress installations until a patch is released.
- Apply virtual patch – Use a Web Application Firewall (WAF) to block requests containing
page=mailmunchwith suspicious characters. - Monitor logs – Review web server logs for exploitation attempts.
Long-Term Fix:
- The vendor must release a patched version that uses
esc_url()oresc_attr()on the output ofadd_query_arg. - If no patch is forthcoming, consider migrating to an alternative email list growth plugin.
Workaround:
- Add a custom filter in WordPress to sanitize the
pageparameter:
add_filter( 'query_vars', function( $vars ) {
$vars[] = 'page';
return $vars;
} );
add_action( 'admin_init', function() {
if ( isset( $_GET['page'] ) && $_GET['page'] === 'mailmunch' ) {
$_GET['page'] = sanitize_text_field( $_GET['page'] );
}
} );
Valters IT
Securing WordPress ecosystems, one CVE 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.