Skip to main content
Public proof of conceptFix available

CVE-2026-31857

A public proof of concept exists; no exploitation attested.

  • Published2026-03-11
  • Fixed in5.9.9 · 4.17.4
  • WeaknessCWE-94

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2026-03-1118:16CVE publishedNVD
  2. 2026-10-2319:23First public proof of conceptPoC-in-GitHub

Versions per branch

NVD · OSV
Craftcms craft cms
BranchAffectedFixed in
5.x≥ 5.0.1, < 5.9.95.9.9
5.x≥ 5.0.0-RC1, < 5.9.95.9.9
4.x≥ 4.0.0.1, < 4.17.44.17.4
4.x≥ 4.0.0-beta.1, < 4.17.44.17.4
4.0= 4.0.0no fix published
5.0= 5.0.0no fix published

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As GitHub_M, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • craftcms cms
    Affected
    • = >= 5.0.0-RC1, < 5.9.9no fix stated
    • = >= 4.0.0-beta.1, < 4.17.4no fix stated

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2026-03-11

Fix

  1. Update Craftcms craft cms to 5.9.9 · 4.17.4

Advisories and patches

Detection

read 2026-11-01 01:02 UTC
Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS 4.0 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
Published
2026-03-11
Last Modified
2026-06-17
NVD status
Analyzed
GitHub Advisory
GHSA-fp5j-j7j4-mcxc

Frequently asked questions

What is CVE-2026-31857?

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.

Is CVE-2026-31857 actively exploited?

Active exploitation of CVE-2026-31857 has not been confirmed. Its EPSS score was 1.1% on 2026-11-18, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2026-31857?

CVE-2026-31857 has a CVSS v3 base score of 8.8 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.

Running craftcms/cms? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record