Craft CMS versions 4.0.0-RC1 up to but not including 4.18.2, and 5.0.0-RC1 up to but not including 5.10.6, contain a vulnerability in the Twig `create()` function that allows an admin user to read arbitrary files on the server. This is possible because the `create()` function can instantiate PHP classes like SplFileObject, which is not blocked, enabling file reads from non-sandboxed template contexts such as entry type title and URI formats. Exploitation requires admin access and the configuration setting `allowAdminChanges` to be true, which is typically disabled in production. The vulnerability exposes sensitive files like `.env` containing security keys and database credentials. The Twig sandbox blocks this function in system email templates, limiting the attack surface. A patch is available for this vulnerability.
Craft CMS versions 4.0.0-RC1 through before 4.18.2 and 5.0.0-RC1 through before 5.10.6 contain a vulnerability where authenticated users with control panel access can leak secret environment variables. This occurs because environment variables are interpolated into Twig templates even when the Twig sandbox is enabled, allowing secrets to be extracted via blind error-based techniques. The vulnerability enables attackers to incrementally exfiltrate sensitive secrets such as the CRAFT_SECURITY_KEY, database credentials, and API keys, potentially leading to session forgery and privilege escalation.
Craft CMS contains an authorization bypass vulnerability allowing users with only viewCategories permission to modify the category structure via the structures/move-element action. This flaw permits reordering and re-parenting categories without saveCategories permission, affecting category URLs and navigation integrity. Verified in version 5.10.5 and related to prior authorization bypasses fixed in earlier versions. No confidentiality or remote code execution impact is present.
A missing authorization check in Craft CMS allows any authenticated control panel user with only the base access permission to retrieve aggregate user registration metrics. The endpoint /actions/charts/get-new-users-data does not enforce the expected 'viewUsers' permission, exposing time-series counts of new user registrations by group and date. No personally identifiable information is disclosed, and the impact is limited to revealing user group sizes and registration trends.
Craft CMS contains a theoretical path traversal vulnerability in the Local file system class's ensurePathIsContained function due to the order of path validation and normalization. Although no exploitable scenario has been identified, the issue could allow desanitization of file paths. A fix is available and recommended for hardening purposes.
A stored cross-site scripting (XSS) vulnerability exists in Craft CMS control panel where an element's draft name is rendered without proper HTML encoding. A low-privilege user who can create drafts can inject JavaScript payloads into the draft name, which execute in the browsers of higher-privileged users viewing the draft's chip or card. This allows the attacker to execute arbitrary JavaScript in the victim's authenticated control panel session, potentially taking over the control panel by performing admin-only actions via the victim's session.
Craft CMS contains a vulnerability that allows any authenticated user to change their own password without providing the current password or having an elevated session. Additionally, users with the 'Edit users' permission can change other users' passwords, including administrators, despite lacking the 'Administrate users' permission. This flaw exists due to improper validation in the user password update process, bypassing intended security checks.
Craft CMS contains an authenticated remote code execution (RCE) vulnerability via the Twig sandbox escape mechanism. The vulnerability arises because the Twig sandbox's allowlisting permits dangerous functionality from the Yii framework, specifically through a function-call gadget in yii\base\Component. An authenticated user with control panel access can exploit this by rendering a malicious Twig template, bypassing sandbox protections. This affects Craft CMS versions from 4.0.0-RC1 up to but not including 4.18.3, and 5.0.0-RC1 up to but not including 5.10.7. A patch is available to remediate this issue.
Craft CMS contains an authenticated remote code execution vulnerability in its control panel element-search condition handling. The flaw arises because the JSON string in the 'condition.config' parameter bypasses the intended configuration cleansing, allowing Yii behavior/event configuration injection. Exploitation requires an authenticated control panel session and a valid CSRF token. Successful exploitation can lead to command execution as the PHP/web user, exposing secrets, database credentials, and enabling site content modification or further internal pivoting.
The `actionRenderCardPreview()` method in `FieldsController` passes the `fieldLayoutConfig` POST parameter directly to `Fields::createLayout()` without calling `Component::cleanseConfig()`. This allows Yii2 event handler injection via `on eventName` keys in the config array, leading to arbitrary code execution.
This is the same vulnerability pattern that was fixed in GHSA-4484-8v2f-5748 (same file, `_fldComponent` method correctly uses `cleanseConfig`), GHSA-qx2q-q59v-wf3j (EntryTypesController), and GHSA-2fph-6v5w-89hh (ElementIndexesController).
## PoC
As an admin user with a valid session:
```
POST /admin/actions/fields/render-card-preview HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Cookie: CraftSessionId=<session>
fieldLayoutConfig[on+init]=phpinfo&CRAFT_CSRF_TOKEN=<token>
```
When the FieldLayout object is constructed, Yii2 processes the `on init` key as an event handler registration. During `Component::init()`, the `init` event is triggered, calling `phpinfo()`. The phpinfo output (which includes environment variables, potentially containing database credentials and `CRAFT_SECURITY_KEY`) will appear in the response.
## Impact
An authenticated admin can achieve RCE through Yii2 event handler injection. While this requires admin access (same as GHSA-4484-8v2f-5748, which was rated moderate), it allows arbitrary PHP function execution and information disclosure via phpinfo.
### Summary
An authenticated path traversal in `assets/icon` allows local SVG file read by passing traversal sequences in the `extension` parameter. The issue is caused by file existence checks happening before extension validation.
### Details
The endpoint:
- `src/controllers/AssetsController.php:1115-1123`
- `actionIcon(string $extension)` calls `Assets::iconPath($extension)` and returns `sendFile($path, ...)`.
In `Assets::iconPath()`:
- Path is built from user-controlled `extension`:
- `src/helpers/Assets.php:906-909`
- If `file_exists($path)` is true, path is returned immediately:
- `src/helpers/Assets.php:910-912`
Validation exists in `Assets::iconSvg()`:
- `preg_match('/^\w+$/', $extension)`
- `src/helpers/Assets.php:927-931`
However, that validation is only reached if `iconPath()` does **not** find a file.
So traversal payloads that resolve to existing `.svg` files bypass validation and are served by `sendFile()`.
### Impact
- Authenticated users can read local .svg files accessible to the application process.
### References
- https://github.com/craftcms/cms/commit/30f5f1a8d6edf0f3a00be72c42c78d9dc7d72d5c
### Summary
A user with Control Panel access but without permission to view a target private asset can call `assets/preview-thumb` and receive preview HTML that contains a signed fallback transform link for that private asset.
### Details
Root-cause analysis:
1. The endpoint accepts an attacker-controlled `assetId`.
2. Asset is resolved, and thumbnail HTML is returned.
3. No explicit asset-view permission check is performed before preview generation.
### Impact
Type:
1. Missing authorization
2. Unauthorized preview-link disclosure
Affected deployments:
1. Craft sites with control panel users who have partial permissions and private assets.
Security consequence:
1. A control panel user without asset-view permission can still obtain signed preview transform link data for private assets.
2. This may increase private asset exposure risk depending on deployment and endpoint chaining.
## Resources
https://github.com/craftcms/cms/commit/d30df3112220db1ffd6726a3ed11857014c7fb27
A vulnerability in Craft CMS up to version 4.18.0.1 allows non-admin control panel users to reorder Global Sets without proper authorization. This authorization bypass affects the actionReorderSets function in the GlobalsController.php file. The issue can be exploited remotely and is addressed by upgrading to version 4.18.1.
Craft CMS is a content management system (CMS). In versions starting from 4.0.0-RC1 and prior to 4.18.0, and 5.0.0-RC1 and above, prior to 5.10.0, the dataUrl() Twig function is included in Craft’s Twig sandbox allowlist, allowing any control panel user granted the utility:system-messages permission to embed a file-reading payload into system email templates. When those emails are sent, the server reads the target file and returns its contents as a base64-encoded data URL embedded in the email body. The .env file, which typically contains the database password, CRAFT_SECURITY_KEY, and third-party API keys, passes all of Craft’s existing dataUrl() protection checks and is fully exfiltrated. Obtaining CRAFT_SECURITY_KEY enables an attacker to forge session tokens and escalate to full admin account takeover. This issue has been fixed in versions 4.18.0 and 5.10.0.
Craft CMS versions 4.x (from 4.0.0-RC1 up to but not including 4.17.0-beta.1) and 5.x (from 5.0.0-RC1 up to but not including 5.9.0-beta.1) contain multiple stored cross-site scripting (XSS) vulnerabilities. These vulnerabilities arise because settings names and field option labels are rendered without proper sanitization, allowing an authenticated administrator with allowAdminChanges enabled to inject malicious JavaScript payloads. This can lead to arbitrary script execution in other users' control-panel sessions. The issue is fixed in versions 4.17.0-beta.1 and 5.9.0-beta.1.
Craft CMS versions from 4.0.0-RC1 contain an authenticated path traversal vulnerability in the assets/icon endpoint. This flaw allows an attacker with valid credentials to bypass extension validation by using path traversal sequences, enabling local SVG file read access. The vulnerability has a CVSS score of 6.5, indicating high severity. No patch or remediation details are provided in the available data. There are no known exploits in the wild at this time.
Craft CMS versions from 4.5.0-beta.1 through 4.16.18 and 5.0.0-RC1 through 5.8.22 contain a stored cross-site scripting (XSS) vulnerability in the editableTable.twig component when using the 'Row Heading' column type. This vulnerability allows an attacker with administrator privileges and the allowAdminChanges setting enabled to inject arbitrary JavaScript code that executes when another user views the affected table field. The issue is fixed in versions 4.16.19 and 5.8.23.
Craft CMS versions 4.0.0-RC1 through 4.17.7 and 5.0.0-RC1 through 5.9.13 contain a missing authorization vulnerability in the assets/preview-thumb endpoint. This flaw allows Control Panel users without asset-view permission to obtain a signed fallback transform preview link for private assets by calling the endpoint with an attacker-controlled assetId. The vulnerability is fixed in versions 4.17.8 and 5.9.14.
Craft CMS version 5.0.0-RC1 contains a stored cross-site scripting (XSS) vulnerability in the User Permissions page. The vulnerability arises because user group names are rendered without proper HTML escaping. An attacker with administrative privileges can inject arbitrary JavaScript code via the user group name field, which executes when other users view or edit permissions. This advisory is a duplicate and has been withdrawn in favor of GHSA-g3hp-vvqf-8vw6.
Craft CMS versions 5.5.0 through 5.9.13 contain a remote code execution vulnerability in the FieldsController::actionRenderCardPreview() method. This flaw allows an authenticated admin user to inject Yii2 event handlers via the fieldLayoutConfig POST parameter, leading to arbitrary PHP code execution and potential disclosure of sensitive information such as environment variables and security keys. The vulnerability is fixed in version 5.9.14.