# CVE-2026-31857: CraftCMS has an RCE vulnerability via relational conditionals in the control panel

- Severity: High 8.1 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.12%, higher than 67% of CVEs (2026-12-01)
- Published: 2026-03-11T14:56:45.000Z
- Modified: 2026-06-17T10:34:38.597Z
- Also known as: GHSA-fp5j-j7j4-mcxc
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- craftcms cms: >= 5.0.0-RC1, < 5.9.9; >= 4.0.0-beta.1, < 4.17.4
- craftcms/cms (Packagist): from 5.0.0-RC1 before 5.9.9; from 4.0.0-beta.1 before 4.17.4
- craftcms craft_cms: from 4.0.0.1 before 4.17.4; from 5.0.1 before 5.9.9; 4.0.0; 5.0.0

## Every score

- GitHub_M: CVSS:4.0 8.1 High `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`
- GitHub: CVSS:4.0 High `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`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc> (patch, vendor-advisory, web)
- <https://github.com/craftcms/cms/commit/8d4903647dcfd31b8d40ed027e27082013347a80> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-31857> (advisory)
- <https://github.com/craftcms/cms> (package)

## Sources

- CVE List: [CVE-2026-31857](https://www.cve.org/CVERecord?id=CVE-2026-31857), CVE Terms of Use, modified 2026-03-12
- GitHub Advisory Database: [GHSA-fp5j-j7j4-mcxc](https://github.com/advisories/GHSA-fp5j-j7j4-mcxc), CC-BY-4.0, modified 2026-03-13
- NVD: [CVE-2026-31857](https://nvd.nist.gov/vuln/detail/CVE-2026-31857), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-31857 · Whole record: https://cve.day/CVE-2026-31857.json · Rebuilt by cve.day 2026-11-25T22:59:15.757Z
