HighGHSA-2453-mppf-46cj
Craft CMS Vulnerable to SQL Injection in Element Indexes via `criteria[orderBy]`
Affected versions
5.0.0-RC1 to before 5.8.22, 4.0.0-RC1 to before 4.16.18 - fixed in 5.8.22Details
## Summary The `element-indexes/get-elements` endpoint is vulnerable to **SQL Injection** via the `criteria[orderBy]` parameter (JSON body). The application fails to sanitize this input before using it in the database query. An attacker with **Control Panel access** can inject arbitrary SQL into the `ORDER BY` clause by omitting `viewState[order]` (or setting both to the same payload). > [!NOTE] > The `ORDER BY` clause executes per row. `SLEEP(1)` on 10 rows = 10s delay. --- ## PoC ### Required Permissions - Access to the Control Panel ### Steps to reproduce 1. Log in to the control panel
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-25495
- https://github.com/craftcms/cms/security/advisories/GHSA-2453-mppf-46cj
- https://nvd.nist.gov/vuln/detail/CVE-2026-25495
- https://github.com/craftcms/cms/commit/96c60d775c644ff0a0276da52fe29e11d4cd38d2
- https://github.com/craftcms/cms
- https://github.com/craftcms/cms/releases/tag/4.16.18
- https://github.com/craftcms/cms/releases/tag/5.8.22
Is your site exposed?Run a free passive scan. See your platform, versions and the issues on your surface in under a minute.
Check if my site is affected