Craft CMS Vulnerable to Authenticated RCE via Twig SSTI - create() function + Symfony Process gadget

Description

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
  • allowAdminChanges enabled 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

  1. Log in as admin
  2. Navigate to Settings → Entry Types
  3. Edit any entry type’s "Title Format" field
  4. Insert the payload above
  5. Create/edit an entry of that type
  6. 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

Basic information

Type
reviewed
Severity
medium
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2026-03-03 20:30:36 UTC
Updated
2026-03-04 18:38:43 UTC
GitHub reviewed
2026-03-03 20:30:36 UTC
NVD published
2026-03-04

EPSS Score

Score Percentile
0.07% 22.38%

CVSS Scores

Base score Version Severity Vector
6.6 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 Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network.
Attack complexity (AC:L)
Exploitation conditions are straightforward and stable.
Attack requirements (AT:P)
Additional preconditions must be present for exploitation.
Privileges required (PR:H)
High privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:H)
High confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:H)
High integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:H)
High availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:N)
No confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:N)
No integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.
Exploit maturity (threat) (E:P)
Proof-of-concept: public PoC exists; no reported exploitation and no known simplification tools.

Identifiers

CWEs

CWE id Name
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
CWE-94 Improper Control of Generation of Code ('Code Injection')
CWE-1336 Improper Neutralization of Special Elements Used in a Template Engine

Credits

  • andreisss (reporter)

Affected packages (2)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
composer craftcms/cms >= 5.8.7, < 5.9.0-beta.1 5.9.0-beta.1
composer craftcms/cms >= 4.0.0-RC1, < 4.17.0-beta.1 4.17.0-beta.1

References

cvelogic Threat Intelligence