CVE-2026-31857
HIGH 8.1CVSS 4.0CraftCMS has an RCE vulnerability via relational conditionals in the control panel
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
- 11 Mar 2026
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-94
- Also known as
- GHSA-fp5j-j7j4-mcxc
- Sources
- NVDJSONOSV GHSA-fp5j-j7j4-mcxcJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | HIGH 8.1 | 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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | 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 | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:*:*:*:*:*:*:*:* |
>= 4.0.0.1, < 4.17.4 | 4.17.4 |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:*:*:*:*:*:*:*:* |
>= 5.0.1, < 5.9.9 | 5.9.9 |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:4.0.0:-:*:*:*:*:*:* |
= 4.0.0 | |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:4.0.0:beta1:*:*:*:*:*:* |
= 4.0.0 | |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:4.0.0:beta2:*:*:*:*:*:* |
= 4.0.0 | |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:4.0.0:beta3:*:*:*:*:*:* |
= 4.0.0 | |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:4.0.0:beta4:*:*:*:*:*:* |
= 4.0.0 | |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:4.0.0:rc1:*:*:*:*:*:* |
= 4.0.0 | |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:4.0.0:rc2:*:*:*:*:*:* |
= 4.0.0 | |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:4.0.0:rc3:*:*:*:*:*:* |
= 4.0.0 | |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:5.0.0:-:*:*:*:*:*:* |
= 5.0.0 | |
| NVD | craftcms | craft_cmscpe:2.3:a:craftcms:craft_cms:5.0.0:rc1:*:*:*:*:*:* |
= 5.0.0 | |
| OSV | Packagist | craftcms/cms | >= 5.0.0-RC1, < 5.9.9 | 5.9.9 |
| OSV | Packagist | craftcms/cms | >= 4.0.0-beta.1, < 4.17.4 | 4.17.4 |
References
- https://github.com/craftcms/cms/commit/8d4903647dcfd31b8d40ed027e27082013347a80 · Patch, WEB
- https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc · Patch, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-31857 · ADVISORY
- https://github.com/craftcms/cms · PACKAGE
History
- 25 Nov 2026 21:01 UTC · NVD: first stored (published 11 Mar 2026)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 11 Mar 2026)