7.5high
Craft affected by authenticated RCE via Twig SSTI - create() function + Symfony Process gadget
- Severity
- 7.5high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.66% (higher than 52% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-94rc-cqvm-m4pw
Description
Craft is a content management system (CMS). There is an authenticated admin RCE in Craft CMS 5.8.21 via Server-Side Template Injection using the create() Twig function combined with a Symfony Process gadget chain. The create() Twig function exposes Craft::createObject(), which allows instantiation of arbitrary PHP classes with constructor arguments. Combined with the bundled symfony/process dependency, this enables RCE. This bypasses the fix implemented for CVE-2025-57811 (patched in 5.8.7). This vulnerability is fixed in 5.9.0-beta.1 and 4.17.0-beta.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| craftcms cms | >= 5.8.7, < 5.9.0-beta.1, >= 4.0.0-RC1, < 4.17.0-beta.1 | CVE List |
| craftcms/cms (Packagist) | from 5.8.7 before 5.9.0-beta.1, from 4.0.0-RC1 before 4.17.0-beta.1 | GitHub Advisory Database |
| craftcms craft_cms | from >4.0.0 before 4.17.0, from >5.0.0 before 5.9.0, 4.0.0, 5.0.0 | NVD |
All scores
| GitHub_M | 7.5high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P |
| NVD | 7.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
Classification
What each source says
CVE List
Craft is a content management system (CMS). There is an authenticated admin RCE in Craft CMS 5.8.21 via Server-Side Template Injection using the create() Twig function combined with a Symfony Process gadget chain. The create() Twig function exposes Craft::createObject(), which allows instantiation of arbitrary PHP classes with constructor arguments. Combined with the bundled symfony/process dependency, this enables RCE. This bypasses the fix implemented for CVE-2025-57811 (patched in 5.8.7). This vulnerability is fixed in 5.9.0-beta.1 and 4.17.0-beta.1.
GitHub Advisory Database
There is an authenticated admin RCE in Craft CMS 5.8.21 via Server-Side Template Injection using the create() Twig function combined with a Symfony Process gadget chain.
This bypasses the fix implemented for CVE-2025-57811 (patched in 5.8.7).
Required Permissions
- Administrator permissions or access to System Messages utility
allowAdminChangesenabled in production (against our security recommendations) or access to System Messages utility
Vulnerability Details
The create() Twig function exposes Craft::createObject(), which allows instantiation of arbitrary PHP classes with constructor arguments. Combined with the bundled symfony/process dependency, this enables RCE.
Attack Vector
Admin panel → Settings → Entry Types → Title Format field
Proof of Concept Payload
{% set p = create("Symfony\\Component\\Process\\Process", [["id"]])
%}{{ p.mustRun.getOutput }}
Steps to Reproduce
- Log in as admin
- Navigate to Settings → Entry Types
- Edit any entry type’s "Title Format" field
- Insert the payload above
- Create/edit an entry of that type
- Command executes, output appears in entry title
Impact
- Authenticated Remote Code Execution
- Runs as web server user (root in default Docker setup)
- Full server compromise
Root Cause
Craft::createObject() allows the instantiation of any class, including
Symfony\Component\Process\Process, which executes shell commands.
Suggested Fix
- Blocklist dangerous classes in createObject() when called from Twig
- Or remove/restrict the create() Twig function
- Or validate class names against an allowlist
Resources
https://github.com/craftcms/cms/commit/e31e50849ad71638e11ea55fbd1ed90ae8f8f6e0
NVD (es)
Craft es un sistema de gestión de contenido (CMS). Hay una RCE de administrador autenticado en Craft CMS 5.8.21 a través de Inyección de Plantilla del Lado del Servidor usando la función Twig create() combinada con una cadena de gadgets de Symfony Process. La función Twig create() expone Craft::createObject(), lo que permite la instanciación de clases PHP arbitrarias con argumentos de constructor. Combinado con la dependencia symfony/process incluida, esto habilita RCE. Esto elude la corrección implementada para CVE-2025-57811 (parcheado en 5.8.7). Esta vulnerabilidad está corregida en 5.9.0-beta.1 y 4.17.0-beta.1.
References
| https://github.com/craftcms/cms/security/advisories/GHSA-94rc-cqvm-m4pw | exploit, mitigation, patch, vendor-advisory, web | |
| https://github.com/craftcms/cms/commit/e31e50849ad71638e11ea55fbd1ed90ae8f8f6e0 | patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-28695 | advisory | |
| https://github.com/craftcms/cms | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-28695 changed 2026-03-06 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-94rc-cqvm-m4pw changed 2026-03-04 | CC-BY-4.0 |
| NVD | CVE-2026-28695 changed 2026-06-17 | Public domain |