CVE-2022-21661: WordPress Core WP_Query SQL Injection Information Disclosure Vulnerability

Published Jan 6, 2022
·
Updated

This vulnerability allows remote attackers to disclose sensitive information on affected installations of WordPress Core. Authentication is not required to exploit this vulnerability. The specific flaw exists within the WPQuery class. The issue results from the lack of proper validation of a user-supplied string before using it to construct SQL queries. An attacker can leverage this vulnerability to disclose stored credentials, leading to further compromise.

Other sources

WordPress is a free and open-source content management system written in PHP and paired with a MariaDB database. Due to improper sanitization in WPQuery, there can be cases where SQL injection is possible through plugins or themes that use it in a certain way. This has been patched in WordPress version 5.8.3. Older affected versions are also fixed via security release, that go back till 3.7.37. We strongly recommend that you keep auto-updates enabled. There are no known workarounds for this vulnerability.

Affected Software

33 affected componentsFixes available
WordPress Core
WordPress WordPress<5.8.3
Fedoraproject Fedora=34
Fedoraproject Fedora=35
Debian Debian Linux=9.0
Debian Debian Linux=10.0
Debian Debian Linux=11.0
WordPress WordPress>=3.7<3.7.37
WordPress WordPress>=3.8<3.8.37
WordPress WordPress>=3.9<3.9.35
WordPress WordPress>=4.0<4.0.34
WordPress WordPress>=4.1<4.1.34
WordPress WordPress>=4.2<4.2.31
WordPress WordPress>=4.3<4.3.27
WordPress WordPress>=4.4<4.4.26
WordPress WordPress>=4.5<4.5.25
WordPress WordPress>=4.6<4.6.22
WordPress WordPress>=4.7<4.7.22
WordPress WordPress>=4.8<4.8.18
WordPress WordPress>=4.9<4.9.19
WordPress WordPress>=5.0<5.0.15
WordPress WordPress>=5.1<5.1.12
WordPress WordPress>=5.2<5.2.14
WordPress WordPress>=5.3<5.3.11
WordPress WordPress>=5.4<5.4.9
WordPress WordPress>=5.5<5.5.8
WordPress WordPress>=5.6<5.6.7
WordPress WordPress>=5.7<5.7.5
WordPress WordPress>=5.8<5.8.3
debian/wordpress<5.8.3+dfsg1-1
5.8.3+dfsg1-1
debian/wordpress<5.8.3+dfsg1-1
5.8.3+dfsg1-1
debian/wordpress<5.8.3+dfsg1-1
5.8.3+dfsg1-1
debian/wordpress
6.1.9+dfsg1-0+deb12u16.8.7+dfsg1-0+deb13u16.8.12+dfsg1-0+deb13u17.1.4+dfsg1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/wordpress to a version that resolves this vulnerability.

    Fixed in 6.1.9+dfsg1-0+deb12u1Fixed in 6.8.7+dfsg1-0+deb13u1Fixed in 6.8.12+dfsg1-0+deb13u1Fixed in 7.1.4+dfsg1-1
  2. Upgrade

    Upgrade debian/wordpress to a version that resolves this vulnerability.

    Fixed in 5.8.3+dfsg1-1
  3. Upgrade

    Upgrade WordPress Core to a version that resolves this vulnerability.

    Fixed in 5.8.3
  4. Upgrade

    Upgrade WordPress Core to a version that resolves this vulnerability.

    Fixed in 3.7.37
  5. Configuration

    Keep auto-updates enabled.

    WordPress Core auto-updates = enabled

Event History

Jan 6, 2022
CVE Published
via MITRE·10:50 PM
Data Sourced
via MITRE·10:50 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·11:15 PM
DescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is CVE-2022-21661?

CVE-2022-21661 is a SQL Injection vulnerability in WordPress Core WP_Query that allows for information disclosure.

2

How does CVE-2022-21661 affect WordPress?

CVE-2022-21661 affects WordPress versions up to and including 5.8.3.

3

What is the severity of CVE-2022-21661?

CVE-2022-21661 has a severity rating of 7.5 (High).

4

How can I fix CVE-2022-21661?

To fix CVE-2022-21661, update your WordPress installation to version 5.8.4 or later.

5

Where can I find more information about CVE-2022-21661?

You can find more information about CVE-2022-21661 on the following websites: [Packet Storm Security](http://packetstormsecurity.com/files/165540/WordPress-Core-5.8.2-SQL-Injection.html), [GitHub commit](https://github.com/WordPress/wordpress-develop/commit/17efac8c8ec64555eff5cf51a3eff81e06317214), [WordPress security advisories](https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-6676-cqfm-gw84).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203