CVE-2026-31858: CraftCMS's `ElementSearchController` Affected by Blind SQL Injection
The ElementSearchController::actionSearch() endpoint is missing the unset() protection that was added to ElementIndexesController in GHSA-2453-mppf-46cj. 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.
Published Mar 11, 2026
Affected packages
craftcms/cms
- Ecosystem
- Composer (PHP)
- Affected
- >= 5.0.0-RC1, <= 5.9.8
- Fixed in
- 5.9.9
- Check
composer show craftcms/cms
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
The ElementSearchController::actionSearch() endpoint is missing the unset() protection that was added to ElementIndexesController in GHSA-2453-mppf-46cj.
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.
Credited to Neosprings.
References
- https://github.com/craftcms/cms/security/advisories/GHSA-2453-mppf-46cj
- https://github.com/craftcms/cms/security/advisories/GHSA-g7j6-fmwx-7vp8
- https://github.com/craftcms/cms/commit/e1a3dd669ae31491b86ad996e88a1d30d33d9a42
- https://nvd.nist.gov/vuln/detail/CVE-2026-31858
- https://github.com/advisories/GHSA-g7j6-fmwx-7vp8
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Composer (PHP) vulnerabilities
All Composer (PHP) entriesGHSA-wg23-69c2-gjc8
Craft CMS: Passkey login accepts replayed WebAuthn assertions
critical9.1Aug 7, 2026CVE-2026-14793
Craft CMS: Missing authorization check allows non-admin control panel users to reorder Global Sets
medium4.3Aug 6, 2026CVE-2026-14794
Craft CMS: Missing authorization check allows non-admin control panel users access to user registration metrics
medium4.3Aug 6, 2026CVE-2026-72778
Craft CMS: Authenticated RCE via `condition.config` JSON cleanse bypass
high8.7Aug 6, 2026CVE-2026-72779
Craft CMS: Arbitrary file read via SplFileObject in non-sandboxed template contexts
medium6.9Aug 6, 2026CVE-2026-72781
Craft CMS: Authenticated RCE through Twig sandbox escape
high8.7Aug 6, 2026
