/

CVE-2026-86732

Severity:

HIGH RISK

(8.8)

Remote Code Execution (CWE-94) in Craft CMS element-index

CVE-2026-86732

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A high-severity remote code execution vulnerability in Craft CMS allows authenticated content editors to influence class instantiation through the element-index endpoint's criteria parameter. Under deployments where an editor can submit crafted criteria and the vulnerable processing path is reachable, an attacker may execute server-side PHP code.

Affected context

The vulnerability occurs in Craft CMS deployments that expose the element-index endpoint to authenticated users with content-editing privileges and process attacker-influenced criteria values. Risk is higher when request logging, PHP object handling, and application runtime permissions allow the vulnerable processing chain to reach executable server-side behavior.

Exploit preconditions

  • Attack surface: The authenticated element-index endpoint
  • Required access: A valid account with content-editor or equivalent permissions
  • Trigger point: Processing of attacker-controlled values in the criteria parameter during image-transform normalization
  • Why exploitation is possible: The request data can influence arbitrary class instantiation and interact with application-managed objects and request-log content before adequate trust boundaries are enforced

Why this happens

The underlying bug is an unsafe object-instantiation and code-execution path in request-driven criteria processing. A user-controlled class value reaches image-transform normalization and can be combined with a PHP gadget chain involving Yii RBAC components, causing data from a request log to be interpreted as executable PHP.

This maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), because attacker-influenced input can ultimately control behavior that evaluates or executes server-side code. The insecure pattern is allowing extensible class resolution and gadget-compatible object behavior from insufficiently trusted request parameters.

Potential impact

  • An attacker may execute arbitrary PHP code with the application's operating-system privileges.
  • The application and its stored content could be compromised.
  • Sensitive configuration data, credentials, or customer information could be exposed.
  • Attackers could modify content, establish persistence, or disrupt site availability.
  • The underlying host or connected services could be affected if runtime privileges are excessive.

General mitigation guidance

Mitigation generally focuses on removing user control over class resolution and reducing the privileges available to request handlers.

Common defensive patterns include:

  • Allowlisting permitted criteria fields, transform types, and classes instead of resolving arbitrary class names.
  • Separating data-only request schemas from executable or extensible object construction.
  • Validating and normalizing input before invoking transformation or object-resolution logic.
  • Preventing application-controlled logs from becoming executable input to any parser or evaluator.
  • Running the application with least-privilege filesystem, database, and operating-system permissions.
  • Restricting sensitive endpoint access to the smallest necessary set of authenticated roles.
  • Applying vendor-provided security fixes through the organization's normal dependency-management process.

How teams detect issues like this

Detection can combine code analysis, runtime monitoring, and authorization review:

  • Use static analysis to identify request parameters passed into class loaders, reflection APIs, dependency injection, or dynamic method dispatch.
  • Review element-index and image-transform handlers for allowlist enforcement and validation order.
  • Monitor for unusual criteria parameters, unexpected class names, anomalous image-transform requests, and suspicious PHP-related content in request metadata or logs.
  • Audit content-editor permissions and confirm that endpoint authorization matches the intended trust model.
  • Use policy enforcement in CI to flag dynamic class resolution from HTTP input and unsafe evaluation of log or request data.
  • Automated security review tools may help identify these patterns, but findings should be validated against deployment-specific authorization and logging behavior.

Sources

SourceLink
github.comgithub.com/craftcms/cms/security/advisories/GHSA-9wcj-wqqh-cqvg
vulncheck.comvulncheck.com/advisories/craft-cms-before-5.10.12-remote-code-execution-via-element-index

Frequently asked

questions

It can be reached through the application's HTTP interface, but exploitation generally requires authenticated access to the affected endpoint and sufficient content-editing privileges.

Not necessarily. The relevant prerequisite is an account authorized to use the element-index functionality in a way that reaches the vulnerable criteria-processing path.

Remove user control over class instantiation, enforce strict allowlists and schemas for criteria values, and apply the vendor's security remediation through the normal dependency-management process.

Treat request parameters as data rather than executable configuration, review dynamic dispatch paths during code review, minimize endpoint privileges, and monitor for anomalous class-resolution or request-log activity.

Find out what's already
exploitable in your codebase.