Live threats

All CVEs / Craftcms

CVE-2026-31857Craftcms Craft Cms

High 8.1 No auth needed

Priority
64
CVSS 4.0
8.1
EPSS
—
Auth required
No
Published
Mar 11, 2026
Updated
Jun 17, 2026
Category
Web application · Cross-platform
Weakness (CWE)
CWE-94
SSVC (CISA)
Exploitation: none · Automatable: yes · Technical impact: total
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/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

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Craft Cms.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
Packagist craftcms/cms ≥ 5.0.0-RC1 < 5.9.9 5.9.9 composer require "craftcms/cms:^5.9.9"
Packagist craftcms/cms ≥ 4.0.0-beta.1 < 4.17.4 4.17.4 composer require "craftcms/cms:^4.17.4"

Per OSV / GitHub Advisories (GHSA-fp5j-j7j4-mcxc). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
craftcmscraft_cms≥ 4.0.0.1 < 4.17.4
craftcmscraft_cms≥ 5.0.1 < 5.9.9
craftcmscraft_cms4.0.0
craftcmscraft_cms4.0.0
craftcmscraft_cms4.0.0
craftcmscraft_cms4.0.0
craftcmscraft_cms4.0.0
craftcmscraft_cms4.0.0
craftcmscraft_cms4.0.0
craftcmscraft_cms4.0.0
craftcmscraft_cms5.0.0
craftcmscraft_cms5.0.0

Official sources

References

Links published by the sources. Open them with care.