Low-privilege RCE through element-search eager loading
Report #HCKRT-9TSYY2 in Craft CMS Vulnerability Disclosure Program
Disclosed Report
StatusClosed
TargetTier 1
Severity
Details
- Program
- Craft CMS Vulnerability Disclosure Program
- Target
- craftcms/cms
- Creation Date
- 7/21/2026 4:36:23 PM
- Severity
- High
- CVSS Score
-
None
- CVE Number
- CVE-2026-79987
- Affected versions
- >= 5.8.0, < 5.10.13
- Visibility
- Disclosed
- Disclosed at
- 9/10/2026 3:26:21 PM
- Author
- @CryptoCat
- Status
- Resolved (Closed)
- Vulnerability Type (CAPEC™)
- OS Command Injection
- Weakness (CWE)
- (CWE-470) Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Summary
A remote, authenticated, non-admin Craft CMS Control Panel user with only the accessCp permission can execute operating system commands as the PHP web worker.
Description
ElementSearchController::actionSearch() accepts criteria.with[*].when from request JSON. Both request-cleansing functions preserve this value, Craft copies it into EagerLoadPlan::$when, and array_filter() invokes it as a PHP callback. Setting when to system and placing a command in the attacker’s own fullName causes the effective call system((string)$currentUser).
The exploit does not require administrator rights, user management permissions, an elevated session, Dev Mode, disabled Twig sandboxing, plugins, victim interaction, or an unusual database state.
Prerequisite
The attacker needs a remote authenticated, non-admin Control Panel account with accessCp permissions. The tested account has admin=false, zero direct permissions, and only group-derived accessCp. It cannot manage other users or change system settings.
This is a separate sibling vulnerability, not a bypass of the CVE-2026-44011 patch. Both issues are reachable through /admin/actions/element-search/search, but CVE-2026-44011 used request-controlled condition.fieldLayouts to inject Yii as and on behavior/event configuration because condition hydration lacked Component::cleanseConfig(). Its Craft 5.9.18 fix added that cleansing boundary, and the tested 5.10.11 code contains that fix.
This report uses the separate criteria.with[*].when branch. The value already passes through both request cleansers, but neither recognizes its callable semantics. Craft copies it to EagerLoadPlan::$when and invokes it directly through array_filter(). No Yii behavior or event injection is involved, so the earlier patch does not address this callback sink.
Impact
Successful exploitation grants the attacker arbitrary execution of operating-system commands with the Craft PHP worker’s privileges.
This permits access to application secrets, environment and database credentials, CMS content, and files readable by the PHP process; modification of content and writable application/runtime files; and disruption of the Craft service. The vulnerability does not by itself grant root privileges or imply a container escape.
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