RCE in Craftcms Cms
CVE-2026-31857
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.
Vulnerability class: RCE (Remote Code Execution)
Published · last modified .
CVSS v3 metric
CVSS v3 base score 8.8 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
EPSS exploit prediction
EPSS 0.011, 66.7th percentile (scored ); unchanged over 30 days. About EPSS.
Affected products
- Craftcms Cms — versions >= 5.0.0-RC1, < 5.9.9, >= 4.0.0-beta.1, < 4.17.4
- Craftcms Craft Cms — versions 4.0.0, 5.0.0
Weakness classification (CWE)
Public exploits and proof-of-concept code
5 public repositories with exploit or proof-of-concept code for this CVE:
- kaizoku73/CVE-2026-31857-PoC (1 star, last pushed 2026-10-08): Proof of Concept for CVE-2026-31857, an authenticated Remote Code Execution vulnerability in Craft CMS caused by unsafe processing of user-controlled Twig expressions.
- 0Asylum/CVE-2026-31857 (1 star, last pushed 2026-09-30): CraftCMS has an RCE vulnerability via relational conditionals in the control panel
- WhiteMachin3/CVE-2026-31857 (last pushed 2026-10-05): CVE-2026-31857 - Craft CMS authenticated RCE timing verifier.
- 0xTatsuki/CVE-2026-31857 (last pushed 2026-10-01): Craft CMS RCE via relational conditionals in the control panel
- TRX-0/CVE-2026-31857-craftcms-ssti (last pushed 2026-09-21)
References
This CVE has public exploit evidence. See the latest CVEs with public exploits.