Loading...
Skip to main content

CVE-2026-31857 — Vulnerability in craftcms/cms — CVE Details

HIGH

CraftCMS has an RCE vulnerability via relational conditionals in the control panel

Published March 11, 2026Updated March 13, 2026Source: osv

Summary

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.

Advisory Timeline

  • First published March 11, 2026 (215 days ago).
  • Last revised March 13, 2026 — 2 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Composer
Update craftcms/cms to 4.17.4 or later
composer require "craftcms/cms:^4.17.4"
Composer
Update craftcms/cms to 5.9.9 or later
composer require "craftcms/cms:^5.9.9"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: packagist (1).

PackageEcosystemAffectedFixed In
craftcms/cms
packagist
4.0.0, 4.0.0-RC1, 4.0.0-RC2, 4.0.0-RC3 (+235 more)4.17.4
craftcms/cms
packagist
5.0.0, 5.0.0-RC1, 5.0.1, 5.0.2 (+152 more)5.9.9

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

Frequently Asked Questions

What is CVE-2026-31857?
CraftCMS has an RCE vulnerability via relational conditionals in the control panel This vulnerability has been assigned a severity rating of HIGH (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2026-31857?
CVE-2026-31857 affects craftcms/cms. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-31857 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-fp5j-j7j4-mcxc

Related CVEs

  • CVE-2024-56145
    CRITICAL

    Craft CMS has potential RCE when PHP `register_argc_argv` config setting is enabled

  • CVE-2023-41892
    CRITICAL

    Craft CMS Remote Code Execution vulnerability

  • CVE-2026-55791
    CRITICAL

    Craft CMS: Blind SSRF and Arbitrary JavaScript Injection via Host Header Poisoning in actionResourceJs

  • CVE-2026-29069
    HIGH

    Craft CMS has unauthenticated activation email trigger with potential user enumeration

  • CVE-2026-25495
    HIGH

    Craft CMS Vulnerable to SQL Injection in Element Indexes via `criteria[orderBy]`

  • CVE-2026-72778
    HIGH

    Craft CMS: Authenticated RCE via `condition.config` JSON cleanse bypass

  • CVE-2026-32267
    HIGH

    Craft CMS Vulnerable to Privilege Escalation/Bypass through UsersController->actionImpersonateWithToken()

  • CVE-2025-68454
    MEDIUM

    Craft CMS vulnerable to potential authenticated Remote Code Execution via Twig SSTI

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies