CVE-2026-31858: craftcms cms · SQL Injection
Affects craftcms cmsSource CVE Database V5
Mentioned vulnerabilities
Not known to be exploited · CVSS 8.7 High : upgrade to 5.9.9 soon.
Data as of 26 Oct 2026, 13:47 UTC
- EPSS
- 0.3% chance of exploitation in 30 days – higher than 29% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 5.9.9
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 11 Mar 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade craftcms/cms to 5.9.9.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| craftcmscms | Affected
| Fixed in– |
GitHubcraftcms/cmspkg:github/craftcms/cmsOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
- Immediate upgrade to Craft CMS version 5.9.9 or later, where the vulnerability is patched.
- Restrict control panel access to trusted users only and enforce strong authentication mechanisms, such as multi-factor authentication, to reduce the risk of compromised accounts.
- Implement web application firewalls (WAFs) with custom rules to detect and block suspicious SQL injection patterns targeting criteria parameters in the CMS endpoints.
- Conduct regular security audits and code reviews to ensure all input validation and sanitization measures are consistently applied across all controllers and endpoints.
- Monitor logs for unusual query patterns or failed login attempts that may indicate exploitation attempts.
- Limit database user privileges used by the CMS to the minimum necessary, preventing execution of arbitrary commands beyond required operations.
- Educate CMS users about the risks of credential compromise and enforce strong password policies.
- Consider network segmentation to isolate CMS infrastructure from critical backend systems to limit lateral movement in case of compromise.
Description
Craft is a content management system (CMS). The ElementSearchController::actionSearch() endpoint is missing the unset() protection that was added to ElementIndexesController in CVE-2026-25495. The exact same SQL injection vulnerability (including criteria[orderBy], the original advisory vector) works on this controller because the fix was never applied to it. Any authenticated control panel user (no admin required) can inject arbitrary SQL via criteria[where], criteria[orderBy], or other query properties, and extract the full database contents via boolean-based blind injection. Users should update to the patched 5.9.9 release to mitigate the issue.