{"id":"CVE-2026-31857","aliases":["GHSA-fp5j-j7j4-mcxc"],"url":"https://o3.security/vulnerability/CVE-2026-31857","summary":"CraftCMS has an RCE vulnerability via relational conditionals in the control panel","details":"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.","published":"2026-03-11T17:30:29.092Z","modified":"2026-08-12T03:51:24.231664087Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"craftcms/cms","fixedVersion":"5.9.9"},{"ecosystem":"Packagist","name":"craftcms/cms","fixedVersion":"4.17.4"}],"fix":{"url":"https://github.com/craftcms/cms/commit/8d4903647dcfd31b8d40ed027e27082013347a80","label":"craftcms/cms@8d49036"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31857.json"},{"type":"ADVISORY","url":"https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31857"},{"type":"FIX","url":"https://github.com/craftcms/cms/commit/8d4903647dcfd31b8d40ed027e27082013347a80"},{"type":"PACKAGE","url":"https://github.com/craftcms/cms"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:24.231664087Z"}}