Skip to main content
VulnerabilityPublished

CVE-2026-31857: craftcms cms · Code Injection

Affects craftcms cmsSource CVE Database V5

0
Compare

Not known to be exploited · CVSS 8.1 High : upgrade to 5.9.9 or 4.17.4 soon.

Data as of 30 Oct 2026, 11:52 UTC

CVSS 4.0 base score
8.1High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.8% chance of exploitation in 30 days – higher than 58% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 5.9.9, 4.17.4
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

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 11 Mar 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: evidence found.

    Public exploit code: GitHub proofs of concept

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), GitHub proofs of concept, the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.

What to do

Upgrade cms and craftcms/cms to 5.9.9 or 4.17.4.

Affected software

ProductAffectedFixed in
craftcmscmsAffected
  • >=5.0.0-RC1 <5.9.9
Fixed in
  • 5.9.9
craftcmscmsAffected
  • >=4.0.0-beta.1 <4.17.4
Fixed in
  • 4.17.4
GitHubcraftcms/cmspkg:github/craftcms/cmsOther threatsAffected
  • <4.17.4
  • <5.9.9
Fixed in
  • 4.17.4
  • 5.9.9

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

To mitigate CVE-2026-31857, organizations should immediately upgrade Craft CMS installations to version 5.9.9 or 4.17.4 or later, where the vulnerability is patched. Until patching is possible, restrict Control Panel access strictly to trusted users and minimize the number of users with any Control Panel privileges. Implement network-level access controls such as VPNs or IP whitelisting to limit exposure of the Control Panel interface. Monitor logs for unusual activity related to element listing endpoints and condition rule submissions. Disable or limit the use of custom condition rules if feasible. Employ web application firewalls (WAFs) with rules targeting suspicious Twig template usage or anomalous POST requests to the CMS backend. Regularly audit user roles and permissions to ensure least privilege principles are enforced. Finally, maintain up-to-date backups and incident response plans to quickly recover from potential compromises.

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.

References

Community reviews

Loading reviews…