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-8872 Overview
The Store Hours for WooCommerce plugin for WordPress contains a Reflected Cross-Site Scripting (XSS) vulnerability affecting all versions up to and including 4.3.20. The flaw results from the use of add_query_arg without proper URL escaping in the plugin's page handling logic. Unauthenticated attackers can inject arbitrary web scripts that execute when a victim clicks a crafted link. The vulnerability is tracked under CWE-79 and CWE-80, covering improper neutralization of script-related HTML tags.
Critical Impact
Attackers can execute arbitrary JavaScript in a victim's browser session, enabling session hijacking, credential theft, and administrative action abuse on affected WordPress sites.
Affected Products
- Bizswoop Store Hours for WooCommerce plugin for WordPress
- All versions up to and including 4.3.20
- WordPress sites running the order-hours-scheduler-for-woocommerce plugin
Discovery Timeline
- 2024-09-26 - CVE-2024-8872 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-8872
Vulnerability Analysis
The vulnerability resides in the plugin's page handling component at includes/Aspect/Page.php around line 155. The code passes user-controllable input into the WordPress add_query_arg function without first sanitizing or escaping the output. WordPress has long documented that add_query_arg and remove_query_arg return unescaped values and must be wrapped with escaping functions such as esc_url before being echoed into HTML output. When the plugin reflects this constructed URL back to the browser, injected JavaScript executes in the context of the vulnerable site.
This is a classic reflected XSS pattern. The payload is not stored server-side; instead, it travels in the URL and executes only for users who follow a crafted link. Because the attack requires no authentication, any visitor can be targeted, including administrators browsing WooCommerce store pages.
Root Cause
The root cause is the omission of output escaping on a URL constructed from request parameters. The plugin uses add_query_arg with request-derived values and emits the result into page markup without applying esc_url or equivalent sanitization. This matches CWE-80, improper neutralization of script-related HTML tags in a web page.
Attack Vector
An attacker crafts a URL to a vulnerable WordPress site that includes a JavaScript payload in a query parameter processed by the plugin. The attacker delivers the link via phishing email, social media, forum post, or malicious advertisement. When a victim clicks the link, their browser renders the reflected payload within the trusted site's origin. The injected script can read cookies, exfiltrate session tokens, perform actions on behalf of the user, or redirect to an attacker-controlled page. If an administrator is tricked into clicking the link, the attacker can abuse elevated privileges to install plugins, modify content, or create new administrative accounts.
See the WordPress Plugin Code Snippet for the pre-patch code location and the Wordfence Vulnerability Report for additional analysis.
Detection Methods for CVE-2024-8872
Indicators of Compromise
- HTTP requests to WooCommerce store-hours pages containing <script>, javascript:, or event-handler attributes (such as onerror=, onload=) in query string parameters.
- Referer headers from external domains preceding requests that include encoded script payloads targeting the plugin's endpoints.
- Unexpected outbound requests from authenticated admin browser sessions to unknown domains following a page load.
Detection Strategies
- Inspect WordPress access logs for URLs targeting the order-hours-scheduler-for-woocommerce plugin that contain reflected parameters with HTML or JavaScript syntax.
- Deploy a Web Application Firewall (WAF) ruleset that flags reflected XSS patterns in query strings bound for WooCommerce plugin endpoints.
- Monitor browser-side Content Security Policy (CSP) violation reports for script execution from inline sources on store pages.
Monitoring Recommendations
- Enable verbose logging on the WordPress site and forward events to a centralized SIEM for correlation of suspicious URL patterns.
- Alert on administrator account activity that follows a click-through from an external referer with suspicious query parameters.
- Track plugin version inventory across WordPress deployments to confirm all instances are above 4.3.20.
How to Mitigate CVE-2024-8872
Immediate Actions Required
- Update the Store Hours for WooCommerce plugin to a version later than 4.3.20 on every WordPress site in your environment.
- Audit administrator accounts and rotate session cookies for any user who may have clicked a suspicious link to the affected site.
- Review WordPress audit logs for unauthorized configuration changes, new user accounts, or plugin installations.
Patch Information
The vendor addressed the issue in a patched release tracked by WordPress Changeset #3157721. The fix applies proper escaping to the URL returned by add_query_arg before it is rendered in page output. Administrators should install the fixed version through the WordPress plugin updates interface or via WP-CLI.
Workarounds
- Deactivate the Store Hours for WooCommerce plugin until the patched version can be deployed.
- Deploy a WAF rule to block requests containing script tags or JavaScript event handlers in query parameters directed at the plugin.
- Enforce a strict Content Security Policy that disallows inline scripts to reduce the impact of reflected XSS payloads.
# Update the plugin using WP-CLI
wp plugin update order-hours-scheduler-for-woocommerce
# Verify the installed version is above 4.3.20
wp plugin get order-hours-scheduler-for-woocommerce --field=version
# If immediate patching is not possible, deactivate the plugin
wp plugin deactivate order-hours-scheduler-for-woocommerce
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

