Description
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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| craftcms | cms | >= 5.0.0-RC1, < 5.9.9, >= 4.0.0-beta.1, < 4.17.4 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 5 repositories
-
kaizoku73/CVE-2026-31857-PoC ★ 1 · Oct 8, 2026
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 · Sep 30, 2026
CraftCMS has an RCE vulnerability via relational conditionals in the control panel
-
WhiteMachin3/CVE-2026-31857 ★ 0 · Oct 5, 2026
CVE-2026-31857 - Craft CMS authenticated RCE timing verifier.
-
0xTatsuki/CVE-2026-31857 ★ 0 · Sep 29, 2026
Craft CMS RCE via relational conditionals in the control panel
-
TRX-0/CVE-2026-31857-craftcms-ssti ★ 0 · Aug 24, 2026
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Packagist | craftcms/cms | >= 5.0.0-RC1, < 5.9.9 | 5.9.9 | GHSA-fp5j-j7j4-mcxc |
| Packagist | craftcms/cms | >= 4.0.0-beta.1, < 4.17.4 | 4.17.4 | GHSA-fp5j-j7j4-mcxc |