/

CVE-2026-60137

Severity:

CRITICAL RISK

(9.1)

SQL Injection (CWE-89) via author__not_in in WordPress

CVE-2026-60137

Received

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Compromise and Data Exfiltration

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Certain versions of WordPress fail to properly sanitize the author__not_in parameter of WP_Query, allowing crafted input to be incorporated directly into SQL statements.

When plugins or themes pass untrusted user data into this parameter, attackers may be able to perform SQL Injection, potentially accessing or modifying sensitive data in the WordPress database.

Affected context

This vulnerability occurs in WordPress instances where plugins, themes, or custom code use WP_Query and forward user-controlled input into the author__not_in parameter without adequate validation.

It primarily affects sites that rely on dynamic query construction based on request parameters, filters, or search features, and where the database account used by WordPress has broad privileges.

Exploit preconditions

  • Attack surface: Web-facing endpoints that rely on WP_Query and expose the author__not_in parameter indirectly (e.g., via URL parameters, form fields, or AJAX handlers).
  • Required access: Ability to send crafted HTTP requests to routes that influence author__not_in, which may be available without authentication or through low-privilege roles, depending on site configuration.
  • Trigger point: Execution of WP_Query with the attacker-controlled author__not_in value, leading to unsafe concatenation in the underlying SQL query.
  • Why exploitation is possible: Input passed to author__not_in is not properly sanitized or parameterized before being embedded into SQL, matching the pattern of CWE-89 SQL Injection.

Why this happens

The underlying bug is an input handling flaw in the path between WP_Query and the database abstraction layer, where the author__not_in parameter can contain values that are incorporated directly into SQL.

Instead of consistently using parameterized queries or robust normalization for this field, the code allows untrusted data to influence query structure.

This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection), in which user-controlled input can alter SQL semantics or inject additional operations.

Potential impact

  • Attackers may read sensitive information from WordPress database tables, including user profiles and configuration data.
  • Attackers could modify or delete content such as posts, pages, comments, and taxonomy entries.
  • Attackers can tamper with authentication-related data (e.g., password hashes or user meta), aiding account takeover.
  • Attackers may insert malicious content or backdoors into options or meta tables, enabling persistent compromise.
  • In environments with overly permissive database accounts, attackers could impact other databases or perform broader data destruction.

General mitigation guidance

Mitigation generally focuses on removing direct use of untrusted data in SQL paths and enforcing strict query construction patterns.

Recommended defensive approaches include:

  • Treating all external input as untrusted and never passing it directly into WP_Query parameters without validation and normalization.
  • Using parameterized queries or query builders that separate data from control information wherever custom SQL is used.
  • Implementing strict whitelists for fields like author__not_in, ensuring only expected integer IDs or known values are allowed.
  • Reducing database account privileges so the application can perform only the minimum operations required.
  • Centralizing input validation for query-related parameters to avoid ad hoc handling in individual plugins or themes.

How teams detect issues like this

Detection efforts can focus on both code-level review and runtime monitoring:

  • Static analysis rules targeting direct concatenation of request data into WP_Query arguments or custom SQL calls, especially around author__not_in.
  • Manual code reviews that examine query-building logic in plugins and themes, looking for unsanitized use of request parameters.
  • Policy-based checks in CI pipelines that flag high-risk patterns, such as dynamic construction of SQL using superglobals ($_GET, $_POST) or arbitrary request values.
  • Database query monitoring or web application firewalls configured to detect anomalous SQL patterns indicative of injection attempts.

Sources

SourceLink
github.comgithub.com/WordPress/wordpress-develop/security/advisories/GHSA-fpp7-x2x2-2mjf
wordpress.orgwordpress.org/news/2026/07/wordpress-7-0-2-release/

Frequently asked

questions

Exploitability depends on how themes or plugins expose author__not_in to users. If it is reachable via public endpoints or non-privileged roles, exploitation can be widespread across a site's user base or even anonymous visitors.

An attacker needs the ability to influence the value passed into author__not_in, typically via HTTP parameters or form submissions. In many implementations this may require no authentication, though some setups may limit it to logged-in users with specific capabilities.

The safest approach is to ensure that only properly validated, type-checked, and normalized values (e.g., integer author IDs) are ever passed into WP_Query parameters, combined with a consistent use of parameterized queries for any custom SQL.

Adopt a secure coding standard that forbids direct use of request data in query construction, enforce centralized input validation, and integrate automated analysis tools in the development pipeline to flag SQL Injection patterns before deployment.

Find out what's already
exploitable in your codebase.