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

Published Mar 11, 2026
·
Updated

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.99 release to mitigate the issue.

Other sources

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.

MITRE

Affected Software

14 affected componentsFixes available
composer/craftcms/cms>=4.0.0-beta.1<=4.17.3
4.17.4
composer/craftcms/cms>=5.0.0-RC1<=5.9.8
5.9.9
CraftCMS Craft CMS>=4.0.0.1<4.17.4
CraftCMS Craft CMS>=5.0.1<5.9.9
CraftCMS Craft CMS=4.0.0
CraftCMS Craft CMS=4.0.0-beta1
CraftCMS Craft CMS=4.0.0-beta2
CraftCMS Craft CMS=4.0.0-beta3
CraftCMS Craft CMS=4.0.0-beta4
CraftCMS Craft CMS=4.0.0-rc1
CraftCMS Craft CMS=4.0.0-rc2
CraftCMS Craft CMS=4.0.0-rc3
CraftCMS Craft CMS=5.0.0
CraftCMS Craft CMS=5.0.0-rc1

Event History

Mar 11, 2026
Advisory Published
via GitHub·02:56 PM
Data Sourced
via GitHub·02:56 PM
DescriptionWeaknessAffected Software
CVE Published
via MITRE·05:30 PM
Data Sourced
via MITRE·05:30 PM
DescriptionWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 PM
RemedyAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-31857?

CVE-2026-31857 is classified as a Remote Code Execution vulnerability which is considered highly severe.

2

How do I fix CVE-2026-31857?

To fix CVE-2026-31857, upgrade Craft CMS to version 4.17.4 or 5.9.9.

3

What is the impact of CVE-2026-31857 on Craft CMS?

CVE-2026-31857 allows authenticated users to execute arbitrary code due to unsanitized input in the Twig rendering process.

4

Which versions of Craft CMS are affected by CVE-2026-31857?

Craft CMS versions between 4.0.0-beta.1 and 4.17.3, and between 5.0.0-RC1 and 5.9.8 are affected by CVE-2026-31857.

5

Is there a workaround for CVE-2026-31857?

Currently, the recommended approach is to update to a fixed version, as there is no official workaround for CVE-2026-31857.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203