All vulnerabilities

Servers and applications

GHSA-957r-qf9p-67xw

Arbitrary file read via SplFileObject in non-sandboxed template contexts

Severity
Low
Published
25 Jul 2026
Last changed
25 Jul 2026
Added to UpHeron
3 Nov 2026
Fixed in
4.18.2, 5.10.6
Weakness
Incomplete deny list (CWE-184)
Sources
Project advisories (GitHub)

Description

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.

  • 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
From craftcms/cms's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
Craft CMSServers and applications · github:craftcms/cms
  • From 4.0.0-RC1 before 4.18.2
  • From 5.0.0-RC1 before 5.10.6

About Craft CMS

Build bespoke content experiences with Craft.

From its GitHub repository.
Monthly downloads (Packagist)
79,322Packagist, 15 Nov 2026
Total downloads (Packagist)
3,879,755Packagist, 15 Nov 2026
GitHub stars
3,628GitHub, 15 Nov 2026
Forks
713GitHub, 15 Nov 2026
Latest release
5.12.1GitHub, 15 Nov 2026
Released
10 Nov 2026GitHub
First published on GitHub
27 Jan 2017GitHub

Release lines

ReleaseLatestSecurity fixes
55.12.1Until 31 Dec 2031
44.18.9Ended 30 Apr 2026
33.9.15Ended 30 Apr 2024
22.9.2Ended 31 Jan 2022

From endoflife.date.

References