CVE-2022-21661: 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 pos

high Affects WordPress core. Feed 2026.10.29.1, updated 2026-10-28; published ; advisory modified .

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 pos

Package
WordPress core WordPress
Affected versions
>=3.7 and <3.7.37 or >=3.8 and <3.8.37 or >=3.9 and <3.9.35 or >=4.0 and <4.0.34 or >=4.1 and <4.1.34 or >=4.2 and <4.2.31 or >=4.3 and <4.3.27 or >=4.4 and <4.4.26 or >=4.5 and <4.5.25 or >=4.6 and <4.6.22 or >=4.7 and <4.7.22 or >=4.8 and <4.8.18 or >=4.9 and <4.9.19 or >=5.0 and <5.0.15 or >=5.1 and <5.1.12 or >=5.2 and <5.2.14 or >=5.3 and <5.3.11 or >=5.4 and <5.4.9 or >=5.5 and <5.5.8 or >=5.6 and <5.6.7 or >=5.7 and <5.7.5 or >=5.8 and <5.8.3
Fixed in
3.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
Severity
high  CVSS 8.0
Exploitation
not on CISA KEV · EPSS 98% (99.9th percentile)
Published
2022-01-06
Source
nvd

References

CWE-89
NVD recordWordPress core advisories

Am I affected?

Find out in one command. phpwarden checks your WordPress install against this advisory and 20,000+ others, ranked by real-world exploitation (CISA KEV + EPSS). Free, offline, open data.

# one-time install
pip install phpwarden

# then
phpwarden wordpress /var/www/html

Or keep it checked automatically with the GitHub Action or a nightly cron; see WordPress docs.

Install docs   How findings are ranked

Related advisories