Authenticated RCE via `condition.config` JSON cleanse bypass
Report #HCKRT-JD662P in Craft CMS Vulnerability Disclosure Program
Disclosed Report
StatusClosed
TargetTier 1
Severity
Details
- Program
- Craft CMS Vulnerability Disclosure Program
- Target
- craftcms/cms
- Creation Date
- 5/19/2026 6:18:25 PM
- Severity
- High
- CVSS Score
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CVE Number
- CVE-2026-78416
- Affected versions
- >= 5.0.0-RC1, < 5.10.6 and >= 4.0.0-RC1, < 4.18.2
- Visibility
- Disclosed
- Disclosed at
- 8/24/2026 3:00:00 PM
- Author
- @saladin
- Status
- Resolved (Closed)
- Vulnerability Type (CAPEC™)
- Code Injection
- Weakness (CWE)
- (CWE-915) Improperly Controlled Modification of Dynamically-Determined Object Attributes
Summary
Craft CMS has an authenticated remote code execution issue in the control panel element-search condition handling.
Craft cleans the outer request-controlled condition array with Component::cleanseConfig(), but Conditions::createCondition() later decodes and merges the JSON string in condition.config without re-running cleanseConfig() on the decoded/merged configuration.
Because condition.config is a JSON string during the first cleanse, Yii special config keys such as as ... and on ... can be hidden inside it. After JSON decoding, those keys reach FieldLayout object creation and are interpreted by Yii as behavior/event configuration.
Description
Preconditions
- The attacker needs an authenticated Craft control panel session.
- A valid CSRF token is required. The token must be copied from the /admin/dashboard response body value named
csrfTokenValue. TheCRAFT_CSRF_TOKENcookie value is not sufficient.
The cleanse bypass was confirmed with a non-executing canary.
Direct array payload:
condition[fieldLayouts][0][as directCanary][class]=NoSuch\CanaryBehavior
Result: HTTP 200, key stripped.
JSON-smuggled payload:
condition.config contains {"fieldLayouts":[{"as jsonCanary":{"class":"NoSuch\\CanaryBehavior"}}]}
Result: Yii behavior/config handling is reached.
This proves the issue is not just a random 500. The direct array is sanitized, while the JSON-decoded config bypasses the intended cleanse boundary.
This is semi-blind RCE. The vulnerable POST response does not return command output directly. The trigger response was a normal JSON response:
{"elements":[],"exactMatch":false}
No external callback, collaborator server, or reverse shell was used.
Impact
An authenticated control panel user can inject Yii behavior/event configuration after Craft’s intended config cleanse boundary. In the confirmed local lab, this led to command execution as the PHP/web user.
The demonstrated execution was semi-blind: the command output was not returned in the vulnerable endpoint response. Instead, the command wrote the output of id to a local webroot file, and the result was retrieved with a second HTTP request.
Potential attacker impact:
- Execute operating system commands as the PHP/web user.
- Read Craft secrets, environment variables, and application configuration.
- Access database credentials and stored site content.
- Modify site content, users, and application state.
- Pivot to internal services reachable from the Craft host or container.
- Cause denial of service or establish persistence depending on deployment permissions.
Timeline
Hackrate
Our platform helps companies to identify software vulnerabilities in a cost-efficient way. It provides a secure and centralized view of ethical hacking projects for your company.
US Patent Applied for HackGATE #63/645,845
Products
From the Blog
-
Hackrate Ranked 1st in Hungary and 22nd Globally at Hack The Box’s Global Cyber Skills Benchmark 2026
May 29 • 13 min read
-
Press release: Hackrate becomes Hungary’s first CVE Numbering Authority
Jan 13 • 5 min read ★
-
Let 2026 be the year bug bounty becomes part of how you build and operate
Jan 05 • 4 min read