CVE-2026-6295: WP Optimizer <= 2.5.0 - Authenticated (Administrator+) SQL Injection via 's' Parameter
The WP Optimizer plugin for WordPress is vulnerable to SQL Injection via the 's' parameter in all versions up to and including 2.5.0. This is due to an unsafe subquery-detection branch in the Query::parsekeycomparefield() method that, when the user-supplied value matches the regex ^[(\s]SELECT\s+, wraps the value in parentheses and embeds it directly into the SQL string without any escaping or quoting. While the normal LIKE code path correctly uses escsql($wpdb->esclike(...)) and wraps the value in single quotes, this branch completely bypasses those protections. Because the attack payload (SELECT ...) contains no single quotes, WordPress's wpmagicquotes() provides no protection. This makes it possible for authenticated attackers with administrator-level access to inject arbitrary SQL subqueries — including time-based blind payloads — that can be used to extract sensitive information from the database.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
WP Optimizer plugin for WordPressto a version that resolves this vulnerability.Fixed in 2.5.0 - Compensating control
Because exploitation requires authenticated attackers with administrator-level access, restrict administrator access to WordPress (limit who can log in with administrator privileges) to reduce the likelihood of SQL injection abuse via the WP Optimizer 's' parameter.
Event History
Frequently Asked Questions
What level of access does an attacker need?
Exploitation requires an authenticated WordPress account with administrator-level privileges. No user interaction is required.
Why does the usual escaping path not prevent this issue?
Values beginning with a SELECT subquery pattern are handled by a separate branch that inserts them directly into the SQL query without escaping or quoting. Payloads containing no single quotes also are not protected by WordPress wp_magic_quotes().
What could an attacker obtain through exploitation?
An administrator-level attacker can inject arbitrary SQL subqueries, including time-based blind queries. This can be used to extract sensitive information from the WordPress database.