LearnCTEM.com, Best CTEM Learning Platform
CVE Intelligence Hub

CVE-2026-31858: Craftcms Craft Cms SQL Injection (CVSS 8.7)

CVE-2026-31858 is a high severity sql injection in Craftcms Craft Cms with a CVSS score of 8.7. Apply the vendor fix and confirm exposure on internet facing and business critical assets first.

Last updated: Jun 17, 2026

Quick answer

Direct answer

CVE-2026-31858 is a high severity sql injection in Craftcms Craft Cms with a CVSS score of 8.7. Apply the vendor fix and confirm exposure on internet facing and business critical assets first.

Risk scores

CVSS base score
8.7HIGH
EPSS probability
0.48%
Higher than 40 percent of all CVEs
CISA KEV
Not listed
CVSS metricWhat it means
Attack vector (AV:N)Network: reachable remotely
Attack complexity (AC:L)Low complexity
Attack requirements (AT:N)No attack requirements
Privileges required (PR:L)Low privileges required
User interaction (UI:N)No user interaction
Confidentiality (VC:H)High confidentiality impact
Integrity (VI:H)High integrity impact
Availability (VA:H)High availability impact

CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

About Craftcms Craft Cms

CVE-2026-31858 affects Craftcms Craft Cms, a product from Craftcms. Before acting, confirm where Craftcms Craft Cms runs in your estate, who owns it and whether it is reachable from the internet, because exposure decides real risk more than the score alone.

What the flaw is

In plain terms: 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.

The weakness class is SQL Injection. Untrusted input changes the meaning of a database query.

Based on its CVSS vector, the flaw can be reached over the network, needs some level of access, and needs no user interaction. Apply the vendor fix and confirm exposure on internet facing and business critical assets first.

Affected versions and timeline

FieldDetail
ProductCraftcms Craft Cms
Affected versionsCraft Cms from 5.0.1 before 5.9.9; Craft Cms 5.0.0
PublishedMar 11, 2026
Last modifiedJun 17, 2026
Added to CISA KEVNot listed
Assigning CNAsecurity-advisories@github.com

How to detect it

  • Inventory every instance of Craftcms Craft Cms and record the running version against the affected range above.
  • Check external attack surface scans for internet facing instances of the component.
  • Review logs on affected systems for unusual requests, errors or new processes around the vulnerable function.
  • Confirm with an authenticated vulnerability scan once your scanner has a check for this CVE.

How to fix it

  • Apply the fixed version of Craftcms Craft Cms named in the vendor advisory.
  • If patching must wait, restrict network access to the affected service and put it behind authentication or a web application firewall rule.
  • Rescan after the change to prove the exposure is gone, then close the ticket.

CTEM action plan

CTEM stageWhat to do for this CVE
ScopeAdd every business service that depends on Craftcms Craft Cms to the current CTEM cycle.
DiscoverFind all instances, including shadow and cloud deployments, and record versions and exposure.
PrioritizeRank using EPSS and CVSS together with asset exposure and business impact.
ValidateConfirm the flaw is reachable and exploitable in your environment and that compensating controls work.
MobilizeAssign the fix to the asset owner with a due date matched to the priority, then verify closure.

CWE References

Technical References

Frequently asked questions

CVE-2026-31858 is a high severity sql injection in Craftcms Craft Cms with a CVSS score of 8.7. Apply the vendor fix and confirm exposure on internet facing and business critical assets first.

Related CVEs

HIGH8.6
CVE-2026-33157
Craftcms Craft Cms

Craft CMS is a content management system (CMS). From version 5.6.0 to before version 5.9.13, a Remote Code Execution (RCE) vulnerability exists in Craft CMS, it can be exploited by any authenticated user with control panel access. This is a bypass of a previous fix. The existing patches add cleanseConfig() to assembleLayoutFromPost() and various FieldsController actions to strip Yii2 behavior/event injection keys ("as" and "on" prefixed keys). However, the fieldLayouts parameter in ElementIndexesController::actionFilterHud() is passed directly to FieldLayout::createFromConfig() without any sanitization, enabling the same behavior injection attack chain. This issue has been patched in version 5.9.13.

Mar 24, 2026
HIGH7.7
CVE-2026-32267
Craftcms Craft Cms

Craft CMS is a content management system (CMS). From version 4.0.0-RC1 to before version 4.17.6 and from version 5.0.0-RC1 to before version 5.9.12, a low-privilege user (or an unauthenticated user who has been sent a shared URL) can escalate their privileges to admin by abusing UsersController->actionImpersonateWithToken. This issue has been patched in versions 4.17.6 and 5.9.12.

Mar 16, 2026
HIGH8.6
CVE-2026-32264
Craftcms Craft Cms

Craft CMS is a content management system (CMS). From version 4.0.0-RC1 to before version 4.17.5 and from version 5.0.0-RC1 to before version 5.9.11, there is a Behavior injection RCE vulnerability in ElementIndexesController and FieldsController. Craft control panel administrator permissions and allowAdminChanges must be enabled for this to work. This issue has been patched in versions 4.17.5 and 5.9.11.

Mar 16, 2026
HIGH8.6
CVE-2026-32263
Craftcms Craft Cms

Craft CMS is a content management system (CMS). From version 5.6.0 to before version 5.9.11, in src/controllers/EntryTypesController.php, the $settings array from parse_str is passed directly to Craft::configure() without Component::cleanseConfig(). This allows injecting Yii2 behavior/event handlers via "as" or "on" prefixed keys, the same attack vector as the original advisory. Craft control panel administrator permissions and allowAdminChanges must be enabled for this to work. This issue has been patched in version 5.9.11.

Mar 16, 2026
HIGH8.1
CVE-2026-31857
Craftcms Craft Cms

Craft is a content management system (CMS). Prior to 5.9.9 and 4.17.4, a Remote Code Execution vulnerability exists in the Craft CMS 5 conditions system. The BaseElementSelectConditionRule::getElementIds() method passes user-controlled string input through renderObjectTemplate() -- an unsandboxed Twig rendering function with escaping disabled. Any authenticated Control Panel user (including non-admin roles such as Author or Editor) can achieve full RCE by sending a crafted condition rule via standard element listing endpoints. This vulnerability requires no admin privileges, no special permissions beyond basic control panel access, and bypasses all production hardening settings (allowAdminChanges: false, devMode: false, enableTwigSandbox: true). Users should update to the patched 5.9.9 or 4.17.4 release to mitigate the issue.

Mar 11, 2026
HIGH8.7
CVE-2026-29174
Craftcms Craft Commerce

Craft Commerce is an ecommerce platform for Craft CMS. Prior to 5.5.3, Craft Commerce is vulnerable to SQL Injection in the inventory levels table data endpoint. The sort[0][direction] and sort[0][sortField] parameters are concatenated directly into an addOrderBy() clause without any validation or sanitization. An authenticated attacker with access to the Commerce Inventory section can inject arbitrary SQL queries, potentially leading to a full database compromise. This vulnerability is fixed in 5.5.3.

Mar 10, 2026
All Craftcms CVEs in 2026
Your next credential

Earn your free CTEM certification.

Learn to scope, prioritize, validate and mobilize fixes for CVEs like CVE-2026-31858 with a free CTEM certification.

Free to takePublicly verifiable

Beginner / Practitioner / Program Leader

Explore certifications