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-13426 Overview
CVE-2024-13426 is a SQL injection vulnerability in the WP-Polls plugin for WordPress, affecting all versions up to and including 2.77.2. The flaw resides in cookie-handling code that fails to escape user-supplied input and does not properly prepare the resulting SQL query. Unauthenticated attackers can append additional SQL statements to existing queries through crafted cookie values. While the query results are not returned to the attacker, a properly constructed payload can inject malicious JavaScript that is stored and later rendered, producing Stored Cross-Site Scripting (XSS).
Critical Impact
Unauthenticated attackers can inject SQL through cookies to store malicious JavaScript, resulting in persistent XSS against WordPress site visitors and administrators.
Affected Products
- WP-Polls plugin for WordPress, all versions through 2.77.2
- WordPress installations using WP-Polls with poll logging enabled
- Sites running the plugin author lesterchan/wp-polls distribution
Discovery Timeline
- 2025-01-22 - CVE-2024-13426 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-13426
Vulnerability Analysis
The vulnerability is classified as SQL Injection [CWE-89]. It is reachable from the network without authentication or user interaction. The plugin reads a poll-related identifier from an HTTP cookie and concatenates the value into a SQL statement executed against the WordPress database. Because the input is not escaped and the query is not parameterized with $wpdb->prepare(), an attacker controlling the cookie value can append arbitrary SQL fragments to the query.
The injected queries execute server-side but their results are never rendered back in the HTTP response. This limits classic data-exfiltration through UNION-based or error-based extraction. However, the injection point writes attacker-controlled content into a logged poll record. When an administrator or user later views the poll log, the injected payload is rendered as HTML, allowing execution of stored JavaScript in the victim's browser session.
Root Cause
The root cause is insufficient sanitization of a cookie value combined with unsafe query construction in polls-logs.php and wp-polls.php. Vulnerable code paths referenced in the vendor advisory include lines 97 and 294 of polls-logs.php and lines 1378 and 1416 of wp-polls.php. These locations either interpolate raw cookie content into SQL or persist the unsanitized value for later output.
Attack Vector
An unauthenticated remote attacker sends an HTTP request to a WordPress site running WP-Polls and sets a crafted cookie value on the request. The plugin parses the cookie, embeds it in a SQL query, and stores the resulting record. A follow-on request or administrative view of the poll log triggers the rendering of the stored payload, executing attacker-supplied JavaScript in the victim's browser. Successful exploitation supports session theft, administrative action forgery, and pivoting to further site compromise. See the Wordfence Vulnerability Analysis for additional technical context.
// No verified proof-of-concept code is published for CVE-2024-13426.
// Refer to the vendor patch changeset for the corrected query construction:
// https://plugins.trac.wordpress.org/changeset?new=3224709%40wp-polls%2Ftrunk
Detection Methods for CVE-2024-13426
Indicators of Compromise
- Unusual cookie values on requests to WordPress endpoints containing SQL metacharacters such as single quotes, UNION, SELECT, or comment sequences like -- and /*.
- New or modified entries in the WP-Polls log tables containing HTML tags, <script> elements, or javascript: URIs.
- Unexpected outbound requests originating from administrator browsers after viewing poll log pages.
Detection Strategies
- Inspect web server and WAF logs for HTTP requests carrying cookies with SQL syntax targeted at poll-related URLs.
- Query the WordPress database for WP-Polls log rows whose stored fields contain script tags or event-handler attributes.
- Correlate visits to poll log administrative pages with anomalous session activity or credential use shortly afterward.
Monitoring Recommendations
- Enable WordPress audit logging for plugin activity and administrator page views involving WP-Polls.
- Monitor for the plugin version string in HTTP responses to identify unpatched installations across the estate.
- Alert on modifications to files under wp-content/plugins/wp-polls/ that are not tied to a scheduled update window.
How to Mitigate CVE-2024-13426
Immediate Actions Required
- Update WP-Polls to a version later than 2.77.2 that includes the fix from WordPress Trac changeset 3224709.
- If an immediate update is not possible, deactivate the WP-Polls plugin until the patched version is deployed.
- Review the WP-Polls log tables and remove any entries containing HTML or JavaScript payloads.
Patch Information
The vendor released a fix in the commit tracked by the WordPress Trac Changeset 3224709. The corrected code sanitizes the cookie-derived value and uses $wpdb->prepare() for the affected SQL statements. Administrators should install the latest release from the WordPress WP Polls Plugin page.
Workarounds
- Deploy a web application firewall rule that blocks or strips SQL metacharacters from WP-Polls-related cookies.
- Restrict access to the WordPress administration interface to trusted networks to reduce exposure of the poll log rendering path.
- Set a strict Content Security Policy that disallows inline scripts to limit the impact of stored XSS payloads.
# Example WordPress CLI update command
wp plugin update wp-polls
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

