CVE-2026-25495
SQL Injection in Craft element-indexes Endpoint via orderBy Parameter
Publication date: 2026-02-09
Last updated on: 2026-02-19
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| craftcms | craft_cms | 4.0.0 |
| craftcms | craft_cms | 4.0.0 |
| craftcms | craft_cms | 4.0.0 |
| craftcms | craft_cms | 4.0.0 |
| craftcms | craft_cms | 5.0.0 |
| craftcms | craft_cms | 5.0.0 |
| craftcms | craft_cms | From 4.0.0 (exc) to 4.16.18 (exc) |
| craftcms | craft_cms | From 5.0.0 (exc) to 5.8.22 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-89 | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability exists in the Craft platform versions 4.0.0-RC1 through 4.16.17 and 5.0.0-RC1 through 5.8.21. It affects the element-indexes/get-elements endpoint, which is vulnerable to SQL Injection via the criteria[orderBy] parameter in the JSON body.
The application does not properly sanitize the input provided in this parameter before using it in a database query. An attacker who has Control Panel access can inject arbitrary SQL code into the ORDER BY clause by manipulating the viewState[order] parameter or by setting both parameters to the same malicious payload.
This vulnerability allows the attacker to execute unintended SQL commands on the database, potentially compromising data integrity or confidentiality. The issue has been fixed in versions 4.16.18 and 5.8.22.
How can this vulnerability impact me? :
This SQL Injection vulnerability can have serious impacts if exploited. An attacker with Control Panel access could execute arbitrary SQL commands on the database, which may lead to unauthorized data access, data modification, or data deletion.
Such exploitation could compromise the confidentiality, integrity, and availability of the data managed by the Craft platform.
Given the high CVSS base score of 8.7, the vulnerability is considered severe and could result in significant damage depending on the data and systems involved.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability be detected on my network or system? Can you suggest some commands?
I don't know
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability, you should upgrade Craft CMS to a patched version. The issue is fixed in versions 4.16.18 and 5.8.22, so updating to at least these versions will resolve the SQL Injection vulnerability in the element-indexes/get-elements endpoint.
Additionally, restrict Control Panel access to trusted users only, as the vulnerability requires Control Panel access to exploit.