CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-265M-7826-WJQM

GHSA-265m-7826-wjqm: Authenticated Remote Code Execution in Craft CMS via condition.config JSON Cleanse Bypass

Alon Barad
Alon Barad
Software Engineer

Aug 7, 2026·7 min read·24 visits

Executive Summary (TL;DR)

An authenticated remote code execution vulnerability exists in Craft CMS versions 4.x and 5.x. The flaw allows an attacker to bypass global configuration sanitization by nesting Yii2 behavior injection keys inside a JSON-encoded search condition property, resulting in command execution when the object is instantiated.

Craft CMS contains an authenticated remote code execution vulnerability due to a sanitization bypass in its search condition configuration parser. An attacker with access to the control panel can inject unsafe Yii2 behavior configurations wrapped inside a JSON-encoded string. When decoded and merged by the application, these keys bypass the global config cleanse filter and are evaluated by the Yii2 component factory, leading to arbitrary code execution.

Vulnerability Overview

Craft CMS utilizes the Yii2 PHP framework as its underlying foundation. In Craft CMS, the control panel allows administrative or authorized users to manage content and build complex element search queries. These search queries rely on dynamically constructed condition rules, which are represented as configuration arrays.

The dynamic instantiation model of Yii2 relies on helper functions such as Yii::createObject() to instantiate components from configuration arrays. Yii2 configurations can dynamically register behaviors using as <behaviorName> and bind event listeners using on <eventName>. To prevent untrusted input from specifying malicious behaviors, Craft CMS implements a global sanitizer method called Component::cleanseConfig().

The vulnerability arises because the search filter configurations are passed as JSON-encoded strings nested inside a config property of the main request data. This encapsulation hides dangerous keys during the primary sanitization run, allowing them to bypass filters. When the backend subsequently parses and merges the configuration, it instantiates components using the malicious properties, resulting in remote code execution.

Root Cause Analysis

In Yii2, custom components are dynamically instantiated based on developer-supplied configuration arrays. When an array is passed to an object creation sink, Yii checks for special properties. Specifically, keys starting with as dynamically attach behaviors to the target class, while keys starting with on register event handlers. This architecture exposes a significant attack surface if an attacker can manipulate these configuration keys.

To secure this mechanism, Craft CMS sanitizes incoming data using Component::cleanseConfig(). This method recursively scans arrays and deletes any keys prefixed with as or on. This implementation ensures that raw client requests cannot register arbitrary behaviors or event handlers.

However, the condition-handling logic in src/services/Conditions.php handles configuration data in a nested manner. In the control panel, search condition builders send the dynamic configuration serialized as a JSON string under the key config['config']. The application's global input sanitizer operates on the outer array structure first. Because the nested configuration is stored as a raw JSON string, the sanitizer does not inspect its contents, and the malicious keys survive the initial check.

When Conditions::createCondition() processes the input, it decodes the JSON string and merges the resulting associative array into the parent $config array. Because this decoded and merged array is not passed through cleanseConfig() a second time, the unsafe keys are restored to active status within the configuration array. The merged array is later processed by the Yii component factory, which loads the malicious behaviors or event handlers.

Code Analysis

The critical failure is located in src/services/Conditions.php. The vulnerable codebase directly decodes the nested JSON and merges it with the main configuration without executing any sanitization on the decoded output. Below is the vulnerable implementation of the createCondition and createConditionRule methods:

public function createCondition(array|string $config): ConditionInterface
{
    // The base config will be JSON-encoded within a `config` key if this came from a condition builder
    if (isset($config['config']) && Json::isJsonObject($config['config'])) {
        $config = array_merge(
            Json::decode(ArrayHelper::remove($config, 'config')),
            $config
        );
    }
    // ...
}

In the patched version, the application imports the craft\helpers\Component as ComponentHelper class to leverage the cleanseConfig() routine. The patch ensures that the decoded array is sanitized immediately upon deserialization, neutralizing any injected properties before the merge.

Below is the patched codebase showing how the data flow is secured in both createCondition and createConditionRule:

use craft\helpers\Component as ComponentHelper;
 
public function createCondition(array|string $config): ConditionInterface
{
    if (isset($config['config']) && Json::isJsonObject($config['config'])) {
        $config = array_merge(
            // The decoded array is explicitly sanitized before merging
            ComponentHelper::cleanseConfig(Json::decode(ArrayHelper::remove($config, 'config'))),
            $config
        );
    }
    // ...
}
 
public function createConditionRule(array|string $config): ConditionRuleInterface
{
    // ...
    } else {
        // The rule configuration is sanitized before extracting the class name
        $newConfig = ComponentHelper::cleanseConfig($newConfig);
        $newClass = ArrayHelper::remove($newConfig, 'class');
    }
    // ...
}

The patch completely eliminates the bypass vector by performing deep sanitization on any dynamic configuration data immediately after it transitions from a passive JSON string to an active PHP array. This prevents the Yii2 framework from ever encountering unsafe as or on directives during the dynamic instantiation of conditions or rules.

Exploitation

To exploit this vulnerability, an attacker must first obtain an authenticated session in the Craft CMS control panel. The session must possess sufficient privileges to trigger or modify element-search criteria, such as viewing or customizing elements in the control panel. Additionally, the attacker must supply a valid Cross-Site Request Forgery (CSRF) token with their HTTP requests to satisfy the application's request validation checks.

During a condition modification request, the attacker intercepts the outgoing HTTP POST request. The attacker injects a malicious payload into the config field within the condition parameter array. This payload is a JSON-encoded object containing a nested configuration structure. Inside this structure, the attacker embeds a key prefixed with as or on to define a custom behavior or register an event handler mapped to a dangerous class capable of executing system commands.

Because the backend decodes this JSON-encoded string and merges it into the configuration array used to construct the search condition, the Yii framework dynamically instantiates the object and attaches the specified behavior. Once attached, the behavior triggers system execution commands using framework utilities. This execution occurs under the permissions of the PHP-FPM or Apache process running the Craft CMS application.

The execution of the injected behavior triggers a semi-blind RCE. Because the web application's endpoint returns a standard JSON HTTP response rather than piping system shell outputs directly back in the response, attackers must verify code execution using side effects. Attackers often verify code execution by writing a payload verification file to a web-accessible directory on the server and calling it via a secondary request.

Impact Assessment

Successful exploitation of this vulnerability grants the attacker arbitrary code execution on the underlying hosting server. Because execution occurs within the context of the web server daemon, the attacker can execute system commands, write files to writable directories, or read arbitrary local files. This leads to a complete compromise of the application and its hosting environment.

From a data confidentiality standpoint, an attacker can access sensitive configuration files, such as the .env file containing database credentials, encryption keys, and API credentials. By reading the database credentials, the attacker can compromise all application tables, exposing user data, cryptographic hashes, and business-critical records.

Additionally, the attacker can perform lateral movement or establish persistence on the server by installing web shells or modifying application scripts. Given that the vulnerability does not require administrative permissions but only an authenticated control panel user with permission to use search filters, the attack surface is broader than typical admin-only remote code execution bugs.

Remediation

The primary remediation strategy is upgrading Craft CMS to a patched release. For environments running the 5.x branch, administrators must upgrade to version 5.10.6 or later. For environments running the 4.x branch, the installation must be upgraded to version 4.18.2 or later. Upgrades can be performed via Composer by running composer update craftcms/cms in the project root directory.

For instances where an immediate upgrade is not feasible, organizations should implement strict access controls on the control panel. Restricting access to trusted IP ranges or VPNs minimizes the risk of unauthorized sessions exploiting the vulnerability. Additionally, monitoring web server logs for anomalous POST requests containing nested as or on properties within search configurations can help detect exploitation attempts.

Security teams should also deploy Web Application Firewall (WAF) rules to detect and block payloads containing JSON-escaped sequences representing malicious keys. Specifically, rules should monitor incoming traffic for patterns such as \"as \" or \"on \" nested inside the config or condition parameter values of POST requests.

Fix Analysis (2)

Technical Appendix

CVSS Score
8.7/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Affected Systems

Craft CMS

Affected Versions Detail

Product
Affected Versions
Fixed Version
Craft CMS
Craft CMS
>= 5.0.0-RC1, < 5.10.65.10.6
Craft CMS
Craft CMS
>= 4.0.0-RC1, < 4.18.24.18.2
AttributeDetail
Vulnerability TypeImproper Control of Generation of Code ('Code Injection') (CWE-94) / Deserialization of Untrusted Data (CWE-502)
Attack VectorNetwork (Authenticated session required with access to search filters)
CVSS Score8.7 (High)
Exploit StatusNone / Proof-of-Concept
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1211Exploitation for Defense Evasion
Defense Evasion
CWE-94
Improper Control of Generation of Code ('Code Injection')

Improper Control of Generation of Code ('Code Injection')

References & Sources

  • [1]GHSA-265m-7826-wjqm GitHub Security Advisory
  • [2]Craft CMS GitHub Repository
  • [3]Craft CMS 5.x Fix Commit
  • [4]Craft CMS 4.x Fix Commit
  • [5]Craft CMS 4.18.2 Release Tag
  • [6]Craft CMS 5.10.6 Release Tag

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
6 views•10 min read
•1 day ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
14 views•12 min read
•1 day ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•1 day ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
13 views•10 min read
•1 day ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
15 views•10 min read
•1 day ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read