MediumGHSA-957r-qf9p-67xw
Craft CMS: Arbitrary file read via SplFileObject in non-sandboxed template contexts
Affected versions
5.0.0-RC1 to before 5.10.6, 4.0.0-RC1 to before 4.18.2 - fixed in 5.10.6Details
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 acc
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-72779
- https://github.com/craftcms/cms/security/advisories/GHSA-957r-qf9p-67xw
- https://nvd.nist.gov/vuln/detail/CVE-2026-72779
- https://github.com/craftcms/cms/commit/7c96fd73df936a10e8f85ae6ef61a9fc3f277c12
- https://github.com/craftcms/cms/commit/87978f11c8f986c40ef41b941d79547230c4d6d9
- https://github.com/craftcms/cms
- https://github.com/craftcms/cms/releases/tag/4.18.2
- https://github.com/craftcms/cms/releases/tag/5.10.6
Is your site exposed?Run a free passive scan. See your platform, versions and the issues on your surface in under a minute.
Check if my site is affected