Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-112774 Overview
Craft CMS versions from 5.8.0 before 5.11.0 contain a remote code execution vulnerability in the ContentBlock::setFieldLayout() method. Authenticated administrators with allowAdminChanges enabled can supply a crafted JSON-string field layout that injects Yii behaviors. The injected as X or on X keys bypass the cleanseConfig() sanitization and execute operating system commands as the web user. Successful exploitation also allows disclosure of application secrets. This issue is tracked as a code injection weakness [CWE-94].
Critical Impact
Authenticated administrators can achieve remote code execution and secret disclosure on vulnerable Craft CMS installations through Yii behavior injection.
Affected Products
- Craft CMS 5.8.0
- Craft CMS versions after 5.8.0 and before 5.11.0
- Deployments with allowAdminChanges enabled
Discovery Timeline
- 2026-10-19 - CVE-2026-112774 published to the National Vulnerability Database
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-112774
Vulnerability Analysis
The vulnerability resides in the ContentBlock::setFieldLayout() method of Craft CMS. When the method processes a JSON-string field layout, it instantiates Yii components from attacker-controlled configuration data. Yii's component configuration syntax supports attaching behaviors with as X keys and event handlers with on X keys. These keys allow arbitrary class instantiation and callable invocation at runtime. The flaw lets an authenticated administrator pivot from configuration editing to arbitrary command execution on the host.
Root Cause
The root cause is incomplete input sanitization in cleanseConfig(). The function fails to strip as X and on X keys from configuration arrays derived from a JSON-string field layout. Yii's component factory interprets these keys to attach behaviors and event handlers that execute PHP callables. Because the configuration path accepts attacker-controlled class names and parameters, the attacker gains code execution as the web server user. The issue falls under [CWE-94] Improper Control of Generation of Code.
Attack Vector
Exploitation requires an authenticated administrator session on a Craft CMS instance where allowAdminChanges is set to true. The attacker submits a crafted JSON string to the ContentBlock field layout endpoint. The payload embeds Yii behavior keys that reference classes capable of invoking system commands. When Craft deserializes and applies the layout, the injected behavior executes under the web user's privileges. See the Craft CMS GitHub Security Advisory and the VulnCheck Advisory for Craft CMS for the full technical breakdown.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-112774
Indicators of Compromise
- POST requests to Craft CMS admin endpoints containing JSON field layout payloads with as or on keys.
- Unexpected child processes spawned by the PHP-FPM or web server process on the Craft CMS host.
- New or modified files under the Craft storage/ or web-root directories outside normal deployment windows.
- Outbound network connections initiated by the web user to unknown hosts shortly after admin configuration changes.
Detection Strategies
- Inspect HTTP request bodies to ContentBlock and field layout routes for configuration keys matching the regular expression "(as|on) [A-Za-z0-9_]+".
- Correlate administrator authentication events with subsequent process execution by the web server account.
- Alert on PHP processes spawning shells, interpreters, or networking utilities such as /bin/sh, bash, python, curl, or wget.
Monitoring Recommendations
- Enable Craft CMS audit logging for administrator actions, including field layout modifications and plugin configuration changes.
- Forward web server and PHP error logs to a centralized analytics platform for behavioral correlation.
- Monitor for file integrity changes in the Craft application directory and template folders.
How to Mitigate CVE-2026-112774
Immediate Actions Required
- Upgrade Craft CMS to version 5.11.0 or later across all environments.
- Audit administrator accounts and revoke access for accounts that no longer require it.
- Review recent field layout and configuration changes for unexpected as or on keys.
- Rotate application secrets, database credentials, and API tokens stored on affected hosts.
Patch Information
Craft CMS resolves this issue in version 5.11.0. The upstream fix extends cleanseConfig() to strip Yii behavior and event handler keys from configuration data sourced from ContentBlock::setFieldLayout(). Refer to the Craft CMS GitHub Security Advisory GHSA-j6r9-fxgv-j7x5 for release notes and verification details.
Workarounds
- Disable allowAdminChanges in production environments by setting it to false in the Craft general configuration file.
- Restrict administrator access to a dedicated management network or VPN until patching completes.
- Place a web application firewall rule in front of Craft to block JSON request bodies that contain as or on configuration keys.
# Configuration example: disable admin changes in production
# config/general.php
return [
'production' => [
'allowAdminChanges' => false,
'disallowRobots' => false,
],
];
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

