Low-privilege RCE through element-search eager loading


Report #HCKRT-9TSYY2 in Craft CMS Vulnerability Disclosure Program

Disclosed Report
StatusClosed
Resolved
TargetTier 1
craftcms/cms
Severity
High
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

Reporter

Created.

Tuesday, July 21, 2026 4:36 PM
Tyrell

Changed to Accepted (Open)

Thursday, July 23, 2026 6:22 AM
brandonkelly

Changed to Resolved (Closed).Hi! The remediation was deployed, if you can bypass the fix, please let us know.

Thursday, July 30, 2026 11:51 PM
brandonkelly

Github Security Advisory has been created. GHSA-9c4j-cjw3-r3xx

Thursday, July 30, 2026 11:52 PM
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

Checking service status...

Hackrate Ethical Hacking Platform |
2026 ©

CVE Program Numbering Authority