SQL injection in WordPress - CVE-2022-21661
Published: January 7, 2022 / Updated: May 31, 2024
Vulnerability details
The vulnerability allows a remote attacker to execute arbitrary SQL queries in database.
The vulnerability exists due to insufficient sanitization of user-supplied data in WP_Query. A remote attacker can send a specially crafted request to the affected application and execute arbitrary SQL commands within the application database.
Successful exploitation of this vulnerability may allow a remote attacker to read, delete, modify data in database and gain complete control over the affected application.
Affected software
wordpress (Debian package)
wordpress
Fedora
How to mitigate CVE-2022-21661
wordpress (Debian package) - addressed in versions 5.0.15+dfsg1-0+deb10u1, 5.7.5+dfsg1-0+deb11u1
wordpress - addressed in versions 5.1.12-1.el7, 5.8.3-1.fc34, 5.8.3-1.fc35
Links to Public Exploits and PoC-codes
- Exploit #9891 - CVE-2022-21661 (CVE-2022-21661 exp for Elementor custom skin.) (May 31, 2024)
- Exploit #9234 - CVE-2022-21661-PoC (A Python PoC of CVE-2022-21661, inspired from z92g's Go PoC) (August 7, 2023)
- Exploit #8935 - SSI-CVE-2022-21661 (Study and exploit the vulnerability CVE-2022-21661 that allows SQL Injections through plugins POST requests to WordPress versions below 5.8.3.) (March 25, 2023)
- Exploit #8575 - CVE-2022-21661 (The first poc video presenting the sql injection test from ( WordPress Core 5.8.2-'WP_Query' / CVE-2022-21661) ) (November 7, 2022)
- Exploit #8200 - CVE-2022-21661 (CVE-2022-21661 exp for Elementor custom skin.) (August 1, 2022)
- Exploit #8190 - CVE-2022-21661 (WordPress WP_Query SQL Injection POC) (July 28, 2022)
- Exploit #7912 - Wordpress-cve-CVE-2022-21661 (Wordpress 5.8.2 CVE-2022-21661 Vuln enviroment POC exploit) (May 29, 2022)
- Exploit #7822 - WordPress Core 5.8.2 - 'WP_Query' SQL Injection (May 13, 2022)
- Exploit #7347 - wordpress-CVE-2022-21661 () (February 13, 2022)
- Exploit #7247 - CVE-2022-21661-WordPress-Core-5.8.2-WP_Query-SQL-Injection (WordPress Core 5.8.2 - 'WP_Query' SQL Injection) (January 19, 2022)