GHSA-957r-qf9p-67xwMedium▾ SunlitCraft CMS: Arbitrary file read via SplFileObject in non-sandboxed template contexts
▾ Sunlit zone — Low / medium · no exploitation signal
impact 27.5 · likelihood 0 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
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.
allowAdminChanges must be true (default in dev/staging, recommended false in production)allowAdminChanges must be true: production best practices recommend false, which prevents entry type configuration changesallowAdminChanges=true are rated lowcreate() function is blocked by the Twig sandbox, so this cannot be exploited via system email templates or any other sandboxed contextAn 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.
craftcms/cms >= 5.0.0-RC1, < 5.10.6craftcms/cms >= 4.0.0-RC1, < 4.18.2Upgrade to a patched release:
craftcms/cms 5.10.6craftcms/cms 4.18.2Connected by shared product, vendor, weakness, or advisory.
GHSA-xxpx-f366-4xpqMediumCraft CMS:Authorization bypass: view-only Categories user can modify category structure via structures/move-element
GHSA-7hxc-f267-h5q7LowCraft CMS: Incorrect path validation could potentially lead to path traversal
GHSA-596p-6jv8-775vMediumCraft CMS: Authenticated leak of secret environment variables
GHSA-265m-7826-wjqmHighCraft CMS: Authenticated RCE via `condition.config` JSON cleanse bypass
GHSA-wg23-69c2-gjc8CriticalCraft CMS: Passkey login accepts replayed WebAuthn assertions
GHSA-p8x7-9vfw-p7vcHighCraft CMS: Arbitrary user password reset leading to administrator account takeover