Database disclosure via unsanitized taxonomy query terms
Published Jan 6, 2022 · Updated Sep 9, 2024
SQL injection in WP_Query in WordPress before 5.8.3 allows remote attackers to disclose database data through plugin or theme query paths. WP_Tax_Query::clean_query passes non-slug and non-name terms through array_unique instead of coercing them to integer IDs before SQL construction. Exploitation requires a plugin or theme to pass attacker-controlled taxonomy query arguments into WP_Query; successful injection can disclose stored credentials.
Summary
What happened
SQL injection in WP_Query in WordPress before 5.8.3 allows remote attackers to disclose database data through plugin or theme query paths. WP_Tax_Query::clean_query passes non-slug and non-name terms through array_unique instead of coercing them to integer IDs before SQL construction. Exploitation requires a plugin or theme to pass attacker-controlled taxonomy query arguments into WP_Query; successful injection can disclose stored credentials.
The record
- CVE
- CVE-2022-21661
- Published
- Jan 6, 2022
- Updated
- Sep 9, 2024
- Vendor
- WordPress.org
- Product
- WordPress
- Classifications
- CWE-89, T1190
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Jan 6, 2022CVE publishedPublication date reported by the CVE source.
- Sep 9, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=< 5.8.3
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- WordPress Core 5.8.2 WP_Query SQL Injectionproof of concept · validated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo