CVE-2022-21661 SQL injection in WordPress

High 8.0 Published Updated

Attackers can exploit improper sanitization in WP_Query to perform SQL injection, potentially reading or modifying database contents.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-21661?

CVE-2022-21661 is a high-severity SQL injection vulnerability in Debian Debian Linux, published on 6 Jan 2022. An attacker needs administrator access to exploit it, with no action from the victim.

Official description

WordPress is a free and open-source content management system written in PHP and paired with a MariaDB database. Due to improper sanitization in WP_Query, 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.

Weakness: CWE-89

Which versions are affected by CVE-2022-21661?

2 open source packages ship an affected version, including wordpress and wordpress-multisite. It affects 3 products.

PackageAffectedFixed in
wordpress BitnamiFrom 3.7.03.7.37, 3.8.37, 3.9.35, 4.0.34, 4.1.34, 4.2.31, 4.3.27, 4.4.26, 4.5.25, 4.6.22, 4.7.22, 4.8.18, 4.9.19, 5.0.15, 5.1.12, 5.2.14, 5.3.11, 5.4.9, 5.5.8, 5.6.7, 5.7.5, 5.8.3
wordpress-multisite BitnamiFrom 3.7.03.7.37, 3.8.37, 3.9.35, 4.0.34, 4.1.34, 4.2.31, 4.3.27, 4.4.26, 4.5.25, 4.6.22, 4.7.22, 4.8.18, 4.9.19, 5.0.15, 5.1.12, 5.2.14, 5.3.11, 5.4.9, 5.5.8, 5.6.7, 5.7.5, 5.8.3

Products include Debian Debian Linux, Fedoraproject Fedora, Wordpress Wordpress.

How do I fix CVE-2022-21661?

Upgrade wordpress to a fixed version for your release line: 3.7.37, 3.8.37, 3.9.35 or 4.0.34.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2022-21661 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-21661 exists.

Public exploit code: 1 Exploit-DB entry, 1 Nuclei template and 13 proofs of concept on GitHub.

All Debian Debian Linux vulnerabilities

Sources

Also known as BIT-wordpress-2022-21661, BIT-wordpress-multisite-2022-21661, DEBIAN-CVE-2022-21661, GHSA-6676-cqfm-gw84, UBUNTU-CVE-2022-21661.

Is CVE-2022-21661 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free