8.7high
Craft CMS 5.0.0-RC1 before 5.10.6 Arbitrary File Read via SplFileObject
- Severity
- 8.7high CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.22% (higher than 13% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- GHSA-957r-qf9p-67xw
Description
Craft CMS 5.0.0-RC1 before 5.10.6 and 4.0.0-RC1 before 4.18.2 contain an arbitrary file read vulnerability. The create() Twig function restricts class instantiation using a 5-entry blocklist that does not include SplFileObject, allowing an authenticated administrator (with allowAdminChanges=true) to configure a malicious entry type title or URI format that instantiates SplFileObject in a non-sandboxed template context. When a user subsequently creates an entry in the affected section, arbitrary files on the server (such as .env containing the security key and database credentials) are read and rendered as entry titles.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| craftcms cms | from 5.0.0-RC1 before 5.10.6, from 4.0.0-RC1 before 4.18.2 Not affected: 5.10.6, 4.18.2 | CVE List |
| craftcms/cms (Packagist) | from 5.0.0-RC1 before 5.10.6, from 4.0.0-RC1 before 4.18.2 | GitHub Advisory Database |
All scores
| VulnCheck | 8.7high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
| VulnCheck | 4.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
Craft CMS 5.0.0-RC1 before 5.10.6 and 4.0.0-RC1 before 4.18.2 contain an arbitrary file read vulnerability. The create() Twig function restricts class instantiation using a 5-entry blocklist that does not include SplFileObject, allowing an authenticated administrator (with allowAdminChanges=true) to configure a malicious entry type title or URI format that instantiates SplFileObject in a non-sandboxed template context. When a user subsequently creates an entry in the affected section, arbitrary files on the server (such as .env containing the security key and database credentials) are read and rendered as entry titles.
GitHub Advisory Database
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
allowAdminChangesmust betrue(default in dev/staging, recommendedfalsein 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
allowAdminChangesmust betrue: production best practices recommendfalse, which prevents entry type configuration changes- Per Craft’s own severity guidelines, findings requiring
allowAdminChanges=trueare 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 CRAFT_SECURITY_KEY, 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.
NVD (es)
Craft CMS 5.0.0-RC1 anterior a 5.10.6 y 4.0.0-RC1 anterior a 4.18.2 contienen una vulnerabilidad de lectura arbitraria de archivos. La función Twig create() restringe la instanciación de clases utilizando una lista de bloqueo de 5 entradas que no incluye SplFileObject, lo que permite a un administrador autenticado (con allowAdminChanges=true) configurar un título de tipo de entrada o formato URI malicioso que instancia SplFileObject en un contexto de plantilla no aislado. Cuando un usuario crea posteriormente una entrada en la sección afectada, los archivos arbitrarios en el servidor (como .env que contiene la clave de seguridad y las credenciales de la base de datos) se leen y se renderizan como títulos de entrada.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-72779 changed 2026-10-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-957r-qf9p-67xw changed 2026-09-01 | CC-BY-4.0 |
| NVD | CVE-2026-72779 changed 2026-10-24 | Public domain |