Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-8797 Overview
CVE-2024-8797 is a Reflected Cross-Site Scripting (XSS) vulnerability [CWE-79] in the WP Booking System – Booking Calendar plugin for WordPress. The flaw affects all versions up to and including 2.0.19.8. The root cause is the use of add_query_arg and remove_query_arg without appropriate escaping on the URL. Unauthenticated attackers can inject arbitrary web scripts that execute in a victim's browser when the user clicks a crafted link. Successful exploitation can lead to session theft, administrative action abuse, or redirection to attacker-controlled content.
Critical Impact
Unauthenticated attackers can execute arbitrary JavaScript in the context of a victim's browser session on a vulnerable WordPress site after social engineering the victim into clicking a malicious link.
Affected Products
- WP Booking System – Booking Calendar plugin for WordPress, versions * through 2.0.19.8
- Vulnerable file: includes/modules/update-checker/views/view-register-website.php
- Fixed in version 2.0.19.10
Discovery Timeline
- 2024-09-14 - CVE-2024-8797 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-8797
Vulnerability Analysis
The vulnerability is a Reflected Cross-Site Scripting flaw classified under [CWE-79]. The plugin constructs URLs using the WordPress helper functions add_query_arg() and remove_query_arg() and then outputs the resulting URL without sanitization or output escaping. Both functions return the current request URI by default when no explicit URL is provided, and that URI is attacker-controllable through query string parameters. Reflecting that unsanitized value back into the page allows an attacker to break out of the attribute context and inject HTML or JavaScript.
Because the exploit path requires user interaction (a victim must click a crafted link), the attack is typically delivered through phishing, forum posts, or malicious advertisements. The Scope change in the CVSS vector indicates that the injected script can access resources beyond the vulnerable component, including authenticated session cookies for the WordPress site.
Root Cause
The root cause is unsafe output of add_query_arg() and remove_query_arg() return values in view-register-website.php. WordPress documentation explicitly warns that these functions do not escape their output and that developers must wrap results with esc_url() before rendering. The vulnerable template omitted this escaping step.
Attack Vector
Exploitation occurs over the network with no authentication required. An attacker crafts a URL pointing to a page served by the vulnerable plugin and appends a malicious query string payload that breaks out of the reflected URL context. When a WordPress administrator or user visits the link, the injected script executes under the site's origin, enabling cookie theft, forced administrative actions through nonce-authenticated requests, or client-side redirection.
See the WordPress Plugin View Register source and the Wordfence Vulnerability Report for technical details.
Detection Methods for CVE-2024-8797
Indicators of Compromise
- Web server access logs containing requests to WP Booking System plugin paths with suspicious query parameters including <script>, javascript:, onerror=, or URL-encoded equivalents such as %3Cscript%3E
- Referer headers from external domains sending traffic to plugin registration or update-checker endpoints
- Unexpected outbound requests from administrator browser sessions to attacker-controlled domains following plugin page visits
Detection Strategies
- Deploy Web Application Firewall (WAF) rules that identify reflected XSS payload patterns in query string parameters on WordPress endpoints
- Inspect HTTP responses from pages generated by view-register-website.php for unescaped query parameter reflection
- Run plugin inventory scans across WordPress estates to flag any installation of WP Booking System at or below version 2.0.19.8
Monitoring Recommendations
- Enable logging of all requests to /wp-admin/ and plugin paths with full query string capture for later analysis
- Alert on anomalous administrator session activity following click events on external links
- Monitor WordPress plugin repositories and vulnerability feeds for new disclosures affecting installed plugins
How to Mitigate CVE-2024-8797
Immediate Actions Required
- Update the WP Booking System – Booking Calendar plugin to version 2.0.19.10 or later on all WordPress installations
- Audit administrator accounts for signs of session hijacking or unauthorized configuration changes
- Educate site administrators on the risk of clicking unverified links to their own WordPress site
Patch Information
The vendor remediated the issue in version 2.0.19.10. The fix adds proper output escaping around the URL returned by add_query_arg() and remove_query_arg() in the update-checker view template. Review the WordPress Plugin Changeset Log for the committed changes.
Workarounds
- Deactivate and remove the WP Booking System plugin until the patched version can be installed
- Deploy a WAF with reflected XSS signature protection in front of the WordPress site
- Restrict access to the plugin's update-checker endpoints through server-level access controls where feasible
# Update WP Booking System plugin via WP-CLI
wp plugin update wp-booking-system --version=2.0.19.10
# Verify installed version
wp plugin get wp-booking-system --field=version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

