Template Injection Affecting craftcms/cms package, versions >=4.0.0-RC1, <4.17.0-beta.1>=5.0.0-RC1, <5.9.0-beta.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.5% (66th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-CRAFTCMSCMS-15440544
  • published10 Mar 2026
  • disclosed3 Mar 2026
  • creditHesham

Introduced: 3 Mar 2026

NewCVE-2026-28697  (opens in a new tab)
CWE-1336  (opens in a new tab)

How to fix?

Upgrade craftcms/cms to version 4.17.0-beta.1, 5.9.0-beta.1 or higher.

Overview

craftcms/cms is a content management system.

Affected versions of this package are vulnerable to Template Injection via the craft.app.fs.write function in Twig templates. An attacker can execute arbitrary system commands and disclose sensitive information by injecting malicious payloads into template fields, which are then rendered and written to a web-accessible directory.

Note: This is only exploitable if the attacker has an authenticated administrator account with allowAdminChanges enabled or access to the System Messages utility.

CVSS Base Scores

version 4.0
version 3.1