SQL injection in WordPress
Key facts
- Attack vector
- Network
- Privileges required
- High
- User interaction
- None
- Attack complexity
- High
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-89.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| WordPress | wordpress-develop | before 5.8.3 | 5.8.3 | Patch available | CNA |
- wordpress-develop VendorWordPress Affected before 5.8.3 Fixed in 5.8.3 Patch available CNA
CPE configurations NVD · 6
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:wordpress:wordpress:*:*:*:*:*:*:*:* | 3.7 to before 3.7.37; 3.8 to before 3.8.37; 3.9 to before 3.9.35; 4.0 to before 4.0.34; 4.1 to before 4.1.34; 4.2 to before 4.2.31; 4.3 to before 4.3.27; 4.4 to before 4.4.26; 4.5 to before 4.5.25; 4.6 to before 4.6.22; 4.7 to before 4.7.22; 4.8 to before 4.8.18; 4.9 to before 4.9.19; 5.0 to before 5.0.15; 5.1 to before 5.1.12; 5.2 to before 5.2.14; 5.3 to before 5.3.11; 5.4 to before 5.4.9; 5.5 to before 5.5.8; 5.6 to before 5.6.7; 5.7 to before 5.7.5; 5.8 to before 5.8.3 | Vulnerable | WordPress |
| cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* | 34 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* | 35 | Vulnerable | Fedoraproject |
| cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* | 9.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* | 11.0 | Vulnerable | Debian |
- cpe:2.3:a:wordpress:wordpress:*:*:*:*:*:*:*:* Versions 3.7 to before 3.7.37; 3.8 to before 3.8.37; 3.9 to before 3.9.35; 4.0 to before 4.0.34; 4.1 to before 4.1.34; 4.2 to before 4.2.31; 4.3 to before 4.3.27; 4.4 to before 4.4.26; 4.5 to before 4.5.25; 4.6 to before 4.6.22; 4.7 to before 4.7.22; 4.8 to before 4.8.18; 4.9 to before 4.9.19; 5.0 to before 5.0.15; 5.1 to before 5.1.12; 5.2 to before 5.2.14; 5.3 to before 5.3.11; 5.4 to before 5.4.9; 5.5 to before 5.5.8; 5.6 to before 5.6.7; 5.7 to before 5.7.5; 5.8 to before 5.8.3 Vulnerable ·WordPress
- cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
- cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* Versions 11.0 Vulnerable ·Debian
Remediation
- Fix · CNA wordpress-develop (WordPress) Fixed in 5.8.3
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Advisory ·
wordpress-develop — FEDORA-2022-e37e1e6c7a
4 records Highest priority Priority HIGH 3 HIGH, 1 MEDIUM
Other records, highest priority first
- TI-2022-06040 Stored XSS in WordPressPriority HIGH 73
- TI-2022-06041 Authenticated Object Injection in Multisites in WordPressPriority HIGH 67
- TI-2022-06042 SQL injection in WordPressPriority MEDIUM 44
- Advisory ·
wordpress-develop — FEDORA-2022-8472dd59ff
4 records Highest priority Priority HIGH 3 HIGH, 1 MEDIUM
Other records, highest priority first
- TI-2022-06040 Stored XSS in WordPressPriority HIGH 73
- TI-2022-06041 Authenticated Object Injection in Multisites in WordPressPriority HIGH 67
- TI-2022-06042 SQL injection in WordPressPriority MEDIUM 44
Show 1 more group
- Advisory ·
wordpress-develop — DSA-5039
4 records Highest priority Priority HIGH 3 HIGH, 1 MEDIUM
Other records, highest priority first
- TI-2022-06040 Stored XSS in WordPressPriority HIGH 73
- TI-2022-06041 Authenticated Object Injection in Multisites in WordPressPriority HIGH 67
- TI-2022-06042 SQL injection in WordPressPriority MEDIUM 44
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2022-21661
References
Exploit 3
Patch 1
Advisory 7
- https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-6676-cqfm-gw84
- https://wordpress.org/news/2022/01/wordpress-5-8-3-security-release/
- https://www.zerodayinitiative.com/advisories/ZDI-22-020/
- DSA-5039
- FEDORA-2022-8472dd59ff
- FEDORA-2022-e37e1e6c7a
- [debian-lts-announce] 20220123 [SECURITY] [DLA 2884-1] wordpress security update
More Wordpress vulnerabilities
- TI-2026-45010 WordPress < 7.0.2 - REST API batch-route confusion and SQL injection issue leading to Remote Code Execution KEVCVSS 3.1CRITICAL 9.8
- TI-2016-08118 The mailSend function in the isMail transport in PHPMailer before 5.2.18 might allow… KEVCVSS 3.1CRITICAL 9.8
- TI-2026-83466 Predictable staging paths let attackers run code in WordPress Core KEVCVSS 3.1HIGH 8.1
- TI-2026-59973 An unauthenticated attacker can make `get_page_template()` page-template resolution… KEVCVSS 3.1HIGH 8.1
- TI-2016-08129 The isMail transport in PHPMailer before 5.2.20 might allow remote attackers to pass… CVSS 3.1CRITICAL 9.8
- TI-2026-42844 WordPress < 7.0.2 - Facilitated SQL Injection via author__not_in in WP_Query KEVCVSS 3.1MEDIUM 5.9
Sources
- CVE-2022-21661 · CVE Program
- CVE-2022-21661 · NVD
- FIRST EPSS
- CVE-2022-21661 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences