{"id":"CVE-2026-31857","published":"2026-03-11T17:30:29Z","modified":"2026-03-12T14:02:26Z","title":"CraftCMS has an RCE vulnerability via relational conditionals in the control panel","vendor":"Craft CMS","product":"cms","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.1,"severity":"HIGH","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01028,"percentile":0.62746,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/craftcms/cms/commit/8d4903647dcfd31b8d40ed027e27082013347a80","tags":["x_refsource_MISC"]}],"priority":{"score":23.2,"factors":[{"name":"EPSS percentile","points":12.55},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.67}]},"exploitSources":{"pocGithub":{"count":4,"skipped":1,"earliest":"2026-09-29","earliestUrl":"https://github.com/0xTatsuki/CVE-2026-31857","repos":[{"name":"0Asylum/CVE-2026-31857","url":"https://github.com/0Asylum/CVE-2026-31857","stars":1,"created":"2026-09-30"},{"name":"kaizoku73/CVE-2026-31857-PoC","url":"https://github.com/kaizoku73/CVE-2026-31857-PoC","stars":1,"created":"2026-10-08"},{"name":"0xTatsuki/CVE-2026-31857","url":"https://github.com/0xTatsuki/CVE-2026-31857","stars":0,"created":"2026-09-29"},{"name":"WhiteMachin3/CVE-2026-31857","url":"https://github.com/WhiteMachin3/CVE-2026-31857","stars":0,"created":"2026-10-05"}]},"first":{"date":"2026-09-29","source":"PoC-in-GitHub","url":"https://github.com/0xTatsuki/CVE-2026-31857"},"provenance":"source"},"vendorSlug":"craft-cms","affectedVersions":[{"vendor":"craftcms","product":"cms","versions":[">= 5.0.0-RC1, < 5.9.9",">= 4.0.0-beta.1, < 4.17.4"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2026-03-12T14:02:18.692736Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"craftcms/cms","vulnerableRanges":[">=5.0.0-RC1, <5.9.9",">=4.0.0-beta.1, <4.17.4"],"patched":["5.9.9","4.17.4"],"from":["GHSA-fp5j-j7j4-mcxc"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-11257","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2026-29069","published":"2026-03-04","fixed":"5.9.0-beta.2","kev":false},{"cve":"CVE-2026-29113","published":"2026-03-10","fixed":"5.9.7","kev":false},{"cve":"CVE-2026-31859","published":"2026-03-11","fixed":"5.9.7","kev":false,"link":{"from":"CVE-2026-31859","to":"CVE-2026-31857","relation":"successor","confidence":"low","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:craftcms/cms","fromFixed":"4.17.3","toFixed":"4.17.4","daysApart":0},{"kind":"version-step","provenance":"source","package":"Packagist:craftcms/cms","fromFixed":"5.9.7","toFixed":"5.9.9","daysApart":0}]}},{"cve":"CVE-2026-31857","published":"2026-03-11","fixed":"5.9.9","kev":false},{"cve":"CVE-2026-31858","published":"2026-03-11","fixed":"5.9.9","kev":false},{"cve":"CVE-2026-32262","published":"2026-03-16","fixed":"5.9.11","kev":false,"link":{"from":"CVE-2026-31857","to":"CVE-2026-32262","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:craftcms/cms","fromFixed":"4.17.4","toFixed":"4.17.5","daysApart":5}]}},{"cve":"CVE-2026-32263","published":"2026-03-16","fixed":"5.9.11","kev":false},{"cve":"CVE-2026-32264","published":"2026-03-16","fixed":"5.9.11","kev":false,"link":{"from":"CVE-2026-31857","to":"CVE-2026-32264","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:craftcms/cms","fromFixed":"4.17.4","toFixed":"4.17.5","daysApart":5}]}}],"package":"Packagist:craftcms/cms"}}