Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2026-31857
March 11, 2026
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.
Affected Packages
https://github.com/craftcms/cms.git (GITHUB):
Affected version(s) >=5.0.0 <5.9.9
Fix Suggestion:
Update to version 5.9.9
https://github.com/craftcms/cms.git (GITHUB):
Affected version(s) >=4.0.0 <4.17.4
Fix Suggestion:
Update to version 4.17.4
craftcms/cms (PHP):
Affected version(s) >=4.0.0-beta.1 <4.17.4
Fix Suggestion:
Update to version 4.17.4
craftcms/cms (PHP):
Affected version(s) >=5.0.0-RC1 <5.9.9
Fix Suggestion:
Update to version 5.9.9
Do you need more information?
Contact Us
CVSS v4
Base Score:
8.1
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
Exploit Maturity
UNREPORTED
CVSS v3
Base Score:
9.8
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Weakness Type (CWE)
Improper Control of Generation of Code ('Code Injection')
EPSS
Base Score:
0.10