GHSA-957r-qf9p-67xw: Composer/craftcms/cms vulnerability

Published Aug 6, 2026
·
Updated

The create() Twig function (introduced in 5.9.0) allows instantiation of arbitrary PHP classes from template code, restricted only by a 5-entry blocklist. SplFileObject is not in the blocklist, enabling arbitrary file read, including .env (security key, DB credentials) and the passwd file from non-sandboxed Twig template contexts, such as entry type title formats and URI formats.

The sandbox correctly blocks create() in system email templates, so this finding applies only to admin-configured, non-sandboxed contexts that require allowAdminChanges=true.

Prerequisites

- Admin access to the Craft control panel - allowAdminChanges must be true (default in dev/staging, recommended false in production) - Admin must be able to edit entry type settings (title format, URI format) - Any user who subsequently creates an entry in the affected section triggers the file read

Limitations

- Requires admin-level access: not exploitable by low-privilege users - allowAdminChanges must be true: production best practices recommend false, which prevents entry type configuration changes - Per Craft’s own severity guidelines, findings requiring allowAdminChanges=true are rated low - The create() function is blocked by the Twig sandbox, so this cannot be exploited via system email templates or any other sandboxed context

Impact

An admin user (or an attacker who has compromised an admin account) can read arbitrary files from the server filesystem by setting a malicious entry type title format using create('SplFileObject', ['/path/to/file']). In production environments, this exposes .env files containing the CRAFTSECURITYKEY, database credentials, API keys, and other secrets. The file contents are rendered as entry titles visible to any user with permission to view entries in the affected section.

The impact is limited by the requirement for admin access and allowAdminChanges=true.

Affected Software

2 affected componentsFixes available
composer/craftcms/cms>=4.0.0-RC1<4.18.2
4.18.2
composer/craftcms/cms>=5.0.0-RC1<5.10.6
5.10.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/craftcms/cms to a version that resolves this vulnerability.

    Fixed in 4.18.2
  2. Upgrade

    Upgrade composer/craftcms/cms to a version that resolves this vulnerability.

    Fixed in 5.10.6
  3. Configuration

    In production, set allowAdminChanges to false (default in dev/staging is true) so admins cannot change entry type settings like title format and URI format, preventing malicious template usage that can trigger arbitrary file reads.

    Craft CMS entry types (title format / URI format) allowAdminChanges = false

Event History

Aug 6, 2026
Advisory Published
via GitHub·09:54 PM
Data Sourced
via GitHub·09:54 PM
DescriptionWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of GHSA-957r-qf9p-67xw?

The severity of GHSA-957r-qf9p-67xw is rated at 41, indicating a significant risk.

2

How does GHSA-957r-qf9p-67xw impact my application?

GHSA-957r-qf9p-67xw allows arbitrary file reads due to the `create()` Twig function, which can expose sensitive information like security keys and database credentials.

3

How do I fix GHSA-957r-qf9p-67xw in my application?

To fix GHSA-957r-qf9p-67xw, update your Craft CMS to the latest version that addresses this vulnerability.

4

What versions of Craft CMS are affected by GHSA-957r-qf9p-67xw?

Craft CMS versions 5.9.0 and above are affected by GHSA-957r-qf9p-67xw.

5

What is the potential impact of exploiting GHSA-957r-qf9p-67xw?

Exploiting GHSA-957r-qf9p-67xw can lead to unauthorized access to sensitive files such as `.env` and user password files.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203