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



CVE-2025-68455

Craft CMS Authenticated RCE via Yii2 Behavior Injection

Alon Barad
Alon Barad
Software Engineer

Feb 28, 2026·5 min read·22 visits

Executive Summary (TL;DR)

Authenticated administrators can execute arbitrary code on the server by sending crafted JSON payloads to the Craft CMS control panel. The vulnerability exploits the Yii2 component configuration mechanism to attach malicious behaviors before the system validates the input.

A critical post-authentication Remote Code Execution (RCE) vulnerability exists in Craft CMS versions 4.x and 5.x due to improper sanitization of configuration arrays passed to the underlying Yii2 framework. By injecting malicious 'behavior' configurations into the `FieldsController`, an attacker with administrative privileges can instantiate arbitrary classes and execute code on the underlying server. This flaw stems from a regression in how user input is merged after sanitization routines have already run.

Architectural Context: Yii2 Components and Behaviors

Craft CMS is built on top of the Yii2 PHP framework, which utilizes a powerful component-based architecture. A core feature of Yii2 is its dependency injection container and configuration system, where objects extending yii\base\Component can be initialized using configuration arrays. These arrays support 'magic' keys that dictate how the object is constructed.

Two specific keys are critical to this vulnerability: as <behaviorName> and on <eventName>. The as key allows developers to dynamically attach 'Behaviors'—classes that inject methods and properties into the component. The on key binds event handlers to the component. While powerful for developers, these features present a significant attack surface if user-controlled input allows the injection of these keys. An attacker can use them to attach arbitrary classes or trigger execution flows that were not intended by the application logic.

To mitigate this, Craft CMS implements a cleanseConfig() method designed to strip these dangerous keys from user input. However, the effectiveness of this sanitization depends entirely on when it is applied in the request lifecycle relative to data merging.

Root Cause Analysis

The vulnerability lies in the src/controllers/FieldsController.php file, specifically within the actionSaveFieldLayout method (and similar endpoints handling layout settings). The application processes configuration data sent via POST requests to update field layouts. The root cause is a logic error in the order of operations regarding input sanitization.

The application correctly identified the need to sanitize the primary configuration array using Component::cleanseConfig(), which removes keys starting with as or on . However, after this sanitization step, the code retrieved an additional settings parameter from the request, decoded it from JSON, and merged it into the already-cleansed configuration array.

Because the merge occurred post-sanitization, the settings array could reintroduce the forbidden as and on keys. When the resulting array was subsequently used to instantiate or configure a component, Yii2 processed these keys, initializing the attacker-defined behaviors. This creates a classic 'Time-of-Check to Time-of-Use' (TOCTOU) style flaw where the data is validated (cleansed) and then modified (merged) before use.

Code Analysis: The Logic Flaw

The following code comparison illustrates the vulnerability in src/controllers/FieldsController.php. In the vulnerable version, the cleanseConfig call happens before the user-supplied $settings are merged into the config.

Vulnerable Code (Simplified):

// 1. Primary config is sanitized
$config = Component::cleanseConfig($config);
 
// 2. User-supplied 'settings' are retrieved
$settings = $this->request->getBodyParam('settings');
 
// 3. Settings are merged into the CLEAN config (VULNERABILITY)
// Malicious 'as' or 'on' keys in $settings bypass step 1
if ($settings) {
    $config = array_merge($config, $settings);
}
 
// 4. Component is created with tainted config
$field = Craft::createObject($config);

Patched Code:

The fix involves ensuring that cleanseConfig is the final step before object creation. The patch moves the sanitization call to after all merging operations are complete.

$settings = $this->request->getBodyParam('settings');
 
if ($settings) {
    $config = array_merge($config, $settings);
}
 
// FIX: Sanitize AFTER merging all user input
$config = Component::cleanseConfig($config);
 
$field = Craft::createObject($config);

By moving the sanitization call to the end of the preparation block, the developers ensure that no matter what data is merged from the request parameters, the dangerous as and on keys are stripped before the Yii2 factory processes the array.

Exploitation Methodology

To exploit this vulnerability, an attacker requires authentication to the Craft CMS Control Panel with permissions to access field layout settings. The attack leverages a specific gadget class available in the Yii2 framework: yii\behaviors\AttributeTypecastBehavior.

The attacker constructs a JSON payload targeting the settings parameter. The payload does two things: it attaches the AttributeTypecastBehavior and configures it to execute a system command. The AttributeTypecastBehavior class has a property typecastBeforeSave which accepts a callable. By binding the behavior's execution to a wildcard event (*), the attacker forces the callable to execute immediately upon component activity.

Payload Structure:

  1. as rce: Attaches yii\behaviors\AttributeTypecastBehavior.
  2. attributeTypes: Maps a dummy attribute to the PHP function exec (or similar).
  3. typecastBeforeSave: Provides the arguments for the command (e.g., touch /tmp/pwned).
  4. on *: Triggers the beforeSave event handler of the behavior on any event.

When the server processes the apply-layout-element-settings action, it instantiates the component. The Yii2 framework sees the as key, attaches the behavior, and due to the on key, triggers the behavior's methods, resulting in the execution of the PHP callable defined in the payload.

Impact and Risk Assessment

The successful exploitation of CVE-2025-68455 results in Remote Code Execution (RCE) in the context of the web server user (typically www-data). Although authentication is required, the risk remains high for several reasons.

First, in many organizations, 'Administrator' access to a CMS is not equivalent to full server root access. This vulnerability bridges that gap, allowing a CMS admin to pivot to the underlying operating system, potentially accessing other applications, database credentials, or environment variables stored on the server.

Second, this vulnerability allows for the installation of persistent backdoors. An attacker could modify the CMS source code or drop web shells that persist even if the CMS credentials are later changed. The vulnerability has a CVSS v3.1 score of 7.2 (High) and a CVSS v4.0 score of 8.6, reflecting the severity of the impact despite the privilege requirement.

Official Patches

Craft CMSRelease notes for Craft CMS 5.8.21 fixing the vulnerability

Fix Analysis (1)

Technical Appendix

CVSS Score
7.2/ 10
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
EPSS Probability
1.13%
Top 99% most exploited

Affected Systems

Craft CMS 5.0.0-RC1 through 5.8.20Craft CMS 4.0.0-RC1 through 4.16.16

Affected Versions Detail

Product
Affected Versions
Fixed Version
Craft CMS
Craft CMS
>= 5.0.0-RC1, < 5.8.215.8.21
Craft CMS
Craft CMS
>= 4.0.0-RC1, < 4.16.174.16.17
AttributeDetail
CWE IDCWE-470
Vulnerability TypeUnsafe Reflection / Object Injection
CVSS v3.17.2 (High)
Attack VectorNetwork (Authenticated)
ImpactRemote Code Execution
Fix ComplexityLow (Update required)

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1059.003Command and Scripting Interpreter: Windows Command Shell
Execution
T1059.004Command and Scripting Interpreter: Unix Shell
Execution
CWE-470
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')

The application uses external input to select which class to instantiate or code to execute, but does not sufficiently restrict the input.

Known Exploits & Detection

SentinelOne / ResearchProof of Concept utilizing yii\behaviors\AttributeTypecastBehavior for RCE

Vulnerability Timeline

Vendor releases patch in version 5.8.21
2024-12-04
CVE-2025-68455 published in NVD
2026-01-05
Variant CVE-2026-25498 discovered in incomplete fix
2026-02-01

References & Sources

  • [1]GitHub Security Advisory: RCE in Craft CMS
  • [2]NVD Entry for CVE-2025-68455
Related Vulnerabilities
CVE-2024-4990CVE-2026-25498

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

•about 8 hours ago•CVE-2026-14669
8.8

CVE-2026-14669: PostgreSQL to_char() Timezone Abbreviation Heap-Based Buffer Overflow

CVE-2026-14669 is a critical heap-based buffer overflow vulnerability in PostgreSQL's date/time formatting function to_char(timestamptz). The flaw arises from unsafe copying of user-controlled timezone abbreviations into a fixed-size internal buffer. An authenticated database user can trigger this issue by setting a long POSIX timezone abbreviation containing custom formatting, allowing them to overwrite adjacent heap structures and hijack execution control to achieve remote code execution (RCE) with the privileges of the 'postgres' operating system user.

Alon Barad
Alon Barad
7 views•6 min read
•2 days ago•CVE-2026-63462
7.5

CVE-2026-63462: Unauthenticated Stack Overflow Denial of Service in Unleash Server

An unauthenticated remote denial of service vulnerability exists in the Unleash feature management platform. By submitting a crafted JSON payload containing deeply nested structures to an OpenAPI-validated endpoint, an attacker can trigger uncontrolled recursion within the error formatting module. This leads to a call-stack exhaustion (RangeError: Maximum call stack size exceeded) inside the Node.js runtime, causing the service to crash immediately without recovery.

Alon Barad
Alon Barad
11 views•6 min read
•2 days ago•CVE-2026-63004
5.5

CVE-2026-63004: Server-Side Request Forgery in Unleash Addon and Integration Subsystem

CVE-2026-63004 is a server-side request forgery (SSRF) vulnerability in the Unleash feature management platform. Authenticated administrators with CREATE_ADDON or UPDATE_ADDON privileges can exploit this vulnerability to initiate requests to loopback addresses, private networks, and cloud metadata endpoints, potentially leading to information disclosure and credential extraction.

Amit Schendel
Amit Schendel
9 views•8 min read
•2 days ago•CVE-2026-63466
4.1

CVE-2026-63466: Process-Wide Security Degradation via Global Module Mutation in Unleash

Prior to version 8.0.3, Unleash's Markdown event formatter directly mutated the global template-escaping function of the shared mustache Node.js module, resulting in a process-wide security degradation where HTML/Markdown escaping was permanently disabled for the application lifetime.

Alon Barad
Alon Barad
3 views•6 min read
•2 days ago•CVE-2026-76904
9.8

CVE-2026-76904: Unauthenticated SQL Injection in GeoTools PostGIS DataStore Component

A critical SQL injection vulnerability exists in the GeoTools open-source Java library. This vulnerability is situated within the post-processing phase of OGC Filter conversion inside the PostGIS DataStore module. Specifically, the `jsonArrayContains` function does not validate or sanitize its arguments before constructing PostgreSQL SQL/JSON path evaluation queries. An unauthenticated remote attacker can exploit this weakness by submitting crafted filters via standard OGC services like WFS or WMS to execute arbitrary SQL commands on the underlying database system.

Alon Barad
Alon Barad
15 views•5 min read
•2 days ago•CVE-2026-61824
8.2

CVE-2026-61824: High-Severity Cross-Site Scripting (XSS) via Unsanitized Site Extractors in Defuddle

CVE-2026-61824 is a high-severity Cross-Site Scripting (XSS) vulnerability in kepano/defuddle before version 0.19.1. Custom site extractors for platforms such as X/Twitter, Substack, and YouTube constructed HTML representations via template string interpolation without output escaping. This allowed malicious pages to bypass standard parser sanitization routines and execute arbitrary JavaScript.

Amit Schendel
Amit Schendel
7 views•7 min read