{"id":"CVE-2026-31857","state":"PUBLISHED","title":"CraftCMS has an RCE vulnerability via relational conditionals in the control panel","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.","publishedAt":"2026-03-11T17:30:29.092Z","updatedAt":"2026-03-12T14:02:26.953Z","severity":{"score":8.1,"label":"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","source":"GitHub_M"},"assigner":"GitHub_M","products":["craftcms cms"],"affected":[{"vendor":"craftcms","product":"cms","versions":[{"version":">= 5.0.0-RC1, < 5.9.9","status":"affected"},{"version":">= 4.0.0-beta.1, < 4.17.4","status":"affected"}]}],"references":["https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc","https://github.com/craftcms/cms/commit/8d4903647dcfd31b8d40ed027e27082013347a80"],"weaknesses":["CWE-94"],"ingestedAt":"2026-10-29T20:11:40.391Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/31xxx/CVE-2026-31857.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-31857","state":"PUBLISHED","datePublished":"2026-03-11T17:30:29.092Z","dateUpdated":"2026-03-12T14:02:26.953Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-03-09T19:02:25.011Z"},"containers":{"cna":{"title":"CraftCMS has an RCE vulnerability via relational conditionals in the control panel","descriptions":[{"lang":"en","value":"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":[{"vendor":"craftcms","product":"cms","versions":[{"version":">= 5.0.0-RC1, < 5.9.9","status":"affected"},{"version":">= 4.0.0-beta.1, < 4.17.4","status":"affected"}]}],"references":[{"url":"https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc","name":"https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/craftcms/cms/commit/8d4903647dcfd31b8d40ed027e27082013347a80","name":"https://github.com/craftcms/cms/commit/8d4903647dcfd31b8d40ed027e27082013347a80","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"HIGH","vulnIntegrityImpact":"HIGH","vulnAvailabilityImpact":"HIGH","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","baseScore":8.1,"baseSeverity":"HIGH","vectorString":"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","version":"4.0"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-94","lang":"en","description":"CWE-94: Improper Control of Generation of Code ('Code Injection')","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-03-11T17:30:29.092Z"},"source":{"advisory":"GHSA-fp5j-j7j4-mcxc","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-03-12T14:02:18.692736Z","id":"CVE-2026-31857","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-03-12T14:02:26.953Z"}}]}}}