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-12435 Overview
CVE-2024-12435 is a Reflected Cross-Site Scripting (XSS) vulnerability in the Compare Products for WooCommerce plugin for WordPress. The flaw affects all plugin versions up to and including 3.2.1. It originates from insufficient input sanitization and output escaping on the s_feature parameter. Unauthenticated attackers can inject arbitrary web scripts that execute when a user clicks a crafted link. The weakness is tracked as CWE-79 and was published to the National Vulnerability Database (NVD) on January 7, 2025.
Critical Impact
Unauthenticated attackers can execute arbitrary JavaScript in a victim's browser session, enabling session theft, credential harvesting, and administrative action abuse on WordPress sites running the vulnerable plugin.
Affected Products
- Compare Products for WooCommerce plugin for WordPress
- All versions up to and including 3.2.1
- WordPress sites with WooCommerce integrating the vulnerable plugin
Discovery Timeline
- 2025-01-07 - CVE-2024-12435 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-12435
Vulnerability Analysis
The Compare Products for WooCommerce plugin accepts user-controlled input through the s_feature HTTP parameter. The plugin processes this value within the class-wc-compare-fields.php admin component and reflects it back into the rendered page output. Because the plugin does not sanitize the input nor escape the output, attacker-supplied markup and script content execute in the context of the user's browser.
Reflected XSS requires user interaction. An attacker crafts a malicious URL containing a payload in the s_feature parameter and tricks an authenticated user, often an administrator, into visiting it. The injected script then runs with the user's privileges within the WordPress origin.
Successful exploitation enables session hijacking, forced actions through the WordPress REST API, injection of persistent backdoors, and theft of nonce tokens used for administrative operations.
Root Cause
The root cause is missing input validation and output encoding for the s_feature parameter within the plugin's admin field handling code. Review of the plugin source at lines 392 and 397 of class-wc-compare-fields.php shows the parameter being echoed into HTML without passing through WordPress sanitization helpers such as sanitize_text_field() or escaping helpers such as esc_attr() or esc_html().
Attack Vector
The attack vector is network-based and requires user interaction. An attacker delivers a crafted link via phishing email, social media, or a compromised third-party site. When the target clicks the link, the vulnerable page reflects the malicious s_feature payload into the DOM and executes it. No authentication is needed to craft or deliver the payload, though the impact scales with the privileges of the victim who clicks it.
See the Wordfence Vulnerability Report for additional technical context on the parameter handling.
Detection Methods for CVE-2024-12435
Indicators of Compromise
- HTTP requests containing suspicious payloads in the s_feature query parameter, including <script>, javascript:, onerror=, or encoded variants
- Outbound requests from administrator browsers to unfamiliar domains shortly after visiting plugin admin pages
- Unexpected creation of new WordPress administrator accounts or modified user roles following admin sessions
- Web server access logs showing long, URL-encoded s_feature values originating from external referrers
Detection Strategies
- Deploy a Web Application Firewall (WAF) rule to flag non-alphanumeric characters, HTML tags, or JavaScript event handlers in the s_feature parameter
- Perform static analysis of installed WordPress plugins to confirm the Compare Products for WooCommerce version against 3.2.1
- Correlate web access logs with endpoint telemetry to identify browser sessions that loaded crafted plugin URLs
- Alert on WordPress audit log entries showing privileged actions immediately following page loads containing reflected parameters
Monitoring Recommendations
- Enable verbose logging on the WordPress reverse proxy or WAF for all requests touching /wp-admin/ paths referencing the Compare Products plugin
- Monitor Content Security Policy (CSP) violation reports for inline script execution attempts on plugin pages
- Track outbound HTTP connections from administrative workstations to newly registered or low-reputation domains
How to Mitigate CVE-2024-12435
Immediate Actions Required
- Update the Compare Products for WooCommerce plugin to a version newer than 3.2.1 that includes the fix from WordPress Changeset #3215166
- Audit WordPress administrator accounts and rotate credentials for any user who may have clicked suspicious links while authenticated
- Review WordPress audit logs for unauthorized administrative actions following the disclosure date
- Deploy a WAF signature to block XSS payloads in the s_feature parameter until patching is complete
Patch Information
The plugin maintainer committed the fix in Changeset #3215166, which adds proper sanitization and escaping to the s_feature parameter handling in class-wc-compare-fields.php. Site administrators should upgrade the plugin through the WordPress admin dashboard or via wp-cli using wp plugin update woocommerce-compare-products.
Workarounds
- Deactivate the Compare Products for WooCommerce plugin until the patched version is installed
- Restrict /wp-admin/ access by source IP address using web server configuration or a reverse proxy
- Enforce a strict Content Security Policy that disallows inline scripts on WordPress admin pages
- Require administrators to use separate browser profiles or sessions for WordPress management tasks
# Configuration example: update the plugin via wp-cli
wp plugin update woocommerce-compare-products
# Verify installed version
wp plugin get woocommerce-compare-products --field=version
# Example nginx rule to block script-like payloads in s_feature
if ($arg_s_feature ~* "(<|%3C)script|javascript:|onerror=") {
return 403;
}
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

