CVE-2026-6295

WP Optimizer <= 2.5.0 - Authenticated (Administrator+) SQL Injection via 's' Parameter

2026-09-18 19:42
san6051

Strategic Overview

Status
Patched in 2.6.0
Affected Version
<= 2.5.0
CVSS
4.9Medium
Weakness type
CWE-89 · Improper Neutralization of Special Elements used in an SQL Command
CVE
CVE-2026-6295
View all WP Optimizer – PageSpeed, Cache, Minify & Core Web Vitals vulnerabilities

At a glance

CVE-2026-6295 is a medium-severity Improper Neutralization of Special Elements used in an SQL Command vulnerability in the WP Optimizer WordPress plugin, affecting versions <= 2.5.0. It carries a CVSS score of 4.9 (reachable over the network; low attack complexity; high confidentiality impact). Exploitation requires an authenticated account at Administrator level or above. The issue is fixed in version 2.6.0; sites on affected versions should update now. Disclosed September 2026, reported by san6051.

Vulnerability Overview

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::parse_key_compare_field() 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 esc_sql($wpdb->esc_like(...)) and wraps the value in single quotes, this branch completely bypasses those protections. Because the attack payload (SELECT ...) contains no single quotes, WordPress's wp_magic_quotes() 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.

Technical Analysis

The vector marks this flaw as remotely reachable over the network, with low attack complexity — no special timing or configuration is needed, and no interaction from a victim user. A successful exploit has high impact on confidentiality.

CWE-89: Improper Neutralization of Special Elements used in an SQL Command

WP Optimizer <= 2.5.0 carries this weakness at parse_key_compare_field(), and reaching it takes an account at Administrator level or above. SQL injection happens when request data is concatenated into a query instead of being bound as a parameter, letting an attacker change the structure of the statement rather than just its values.

A working injection can read any table the database user can see, which on a WordPress install means user records, password hashes and session or API secrets stored in options. For WP Optimizer the fix is 2.6.0: builds <= 2.5.0 are affected, anything from 2.6.0 onward is not.

Remediation

Update to version 2.6.0, or a newer patched version

How does WordSec protect against this?

An attacker needs Administrator access first, so the firewall sees the attempt as traffic from a logged-in account: WordSec's web application firewall inspects request payloads before WordPress loads them. None of that substitutes for the fix: WP Optimizer 2.6.0 closes this, and updating the plugin is the step that ends it.

  • Firewall
  • Alerts

External References

Related records

Other vulnerabilities in WP Optimizer – PageSpeed, Cache, Minify & Core Web Vitals

Vulnerability data © Defiant, Inc., provided under the Wordfence Intelligence T&C