Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. craftcms/cms
  4. ›
  5. GHSA-957r-qf9p-67xw

GHSA-957r-qf9p-67xw: Craft CMS: Arbitrary file read via SplFileObject in non-sandboxed template contexts

August 6, 2026

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.

References

  • github.com/advisories/GHSA-957r-qf9p-67xw
  • github.com/craftcms/cms/commit/7c96fd73df936a10e8f85ae6ef61a9fc3f277c12
  • github.com/craftcms/cms/commit/87978f11c8f986c40ef41b941d79547230c4d6d9
  • github.com/craftcms/cms/releases/tag/4.18.2
  • github.com/craftcms/cms/releases/tag/5.10.6
  • github.com/craftcms/cms/security/advisories/GHSA-957r-qf9p-67xw

Code Behaviors & Features

Detect and mitigate GHSA-957r-qf9p-67xw with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 4.0.0-RC1 before 4.18.2, all versions starting from 5.0.0-RC1 before 5.10.6

Fixed versions

  • 4.18.2
  • 5.10.6

Solution

Upgrade to versions 4.18.2, 5.10.6 or above.

Impact 4.9 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-184: Incomplete List of Disallowed Inputs

Source file

packagist/craftcms/cms/GHSA-957r-qf9p-67xw.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:18:51 +0000.