What is Craft CMS?
Craft CMS is a popular open-source PHP content management system built on the Yii framework, used by businesses and agencies worldwide for website and web application development. It is deployed as a self-hosted application on LAMP/LEMP stacks and is commonly internet-accessible as a website backend. Craft CMS stores a critical application secret called the "security key" in its .env file — this key is used for signing session tokens, generating CSRF tokens, and protecting sensitive operations.
Overview
CVE-2025-23209 is a code injection vulnerability (CWE-94) in Craft CMS triggered through improper validation of the database backup path. When an attacker has obtained a Craft CMS installation's security key (through prior compromise, misconfiguration, or disclosure), they can use the key to craft malicious session data that results in remote code execution on the web server. The CVSS metrics reflect that exploitation requires both prior knowledge of the security key (AC:H) and a low-privileged Craft account (PR:L).
Affected Versions
| Product | Vulnerable | Fixed |
|---|---|---|
| Craft CMS 4.x | < 4.13.2 | 4.13.2 |
| Craft CMS 5.x | < 5.5.2 | 5.5.2 |
Technical Details
The code injection (CWE-94) exploits Craft CMS's database backup path validation. The backup path is processed by Craft's template engine or a file handling function without sufficient sanitization, allowing an attacker to inject PHP code or template directives.
Prerequisite — security key knowledge: The attack requires the attacker to know the Craft installation's SECURITY_KEY from the .env file. Common ways this key is obtained:
.envfile exposed via misconfigured web server (directory traversal,.envaccessible via HTTP)- Prior compromise of the server or source code repository
- Leaked via CI/CD configuration, public GitHub repositories, or backup files
With the security key known, the attacker can forge authenticated Craft sessions and interact with administrative endpoints, including the database backup path functionality.
Relationship to other Craft CMS CVEs: This is one of several Craft CMS code injection vulnerabilities in 2024-2025. CVE-2024-56145 (Dec 2024, register_argc_argv exploitation), CVE-2025-32432 (Yii framework path — both later enriched here), and this CVE represent a sustained pattern of Craft CMS RCE vulnerabilities.
Discovery
Reported to Craft CMS and fixed in January 2025 release.
Exploitation Context
CISA confirmed active exploitation and added to the KEV catalog on February 20, 2025. Organizations where .env files were previously exposed via a separate vulnerability (path traversal, LFI) are at particular risk — an attacker who obtained the security key from a prior disclosure can now use CVE-2025-23209 for RCE without further authentication.
Remediation
- Upgrade Craft CMS to 4.13.2+ or 5.5.2+ immediately. The CISA deadline was March 13, 2025.
- Rotate the
SECURITY_KEYin your.envfile — if the key was ever exposed or may have been exposed, regenerating it invalidates any forged session tokens. Usephp craft setup/security-keyto regenerate. - Protect
.envfile access — ensure your web server configuration blocks HTTP access to.envand other configuration files. Test withcurl https://yoursite.com/.env. - Audit web server logs for requests to
/admin/utilities/db-backupor similar backup endpoints from unexpected users or IP addresses. - Review all Craft CMS versions for the full chain of recent CVEs and apply all patches.
Key Details
| Property | Value |
|---|---|
| CVE ID | CVE-2025-23209 |
| Vendor / Product | Craft CMS — Craft CMS |
| NVD Published | 2025-01-18 |
| NVD Last Modified | 2025-10-24 |
| CVSS 3.1 Score | 8 |
| CVSS 3.1 Vector | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H |
| Severity | HIGH |
| CWE | CWE-94 find similar ↗ |
| CISA KEV Added | 2025-02-20 |
| CISA KEV Deadline | 2025-03-13 |
| Known Ransomware Use | No |
CVSS 3.1 Breakdown
Required Action
Timeline
| Date | Event |
|---|---|
| 2025-01-18 | CVE published; Craft CMS 4.13.2 and 5.5.2 released with fix |
| 2025-02-20 | Added to CISA Known Exploited Vulnerabilities catalog |
| 2025-03-13 | CISA BOD 22-01 remediation deadline |
References
| Resource | Type |
|---|---|
| GitHub Security Advisory GHSA-x684-96hh-833x — Craft CMS CVE-2025-23209 | Vendor Advisory |
| NVD — CVE-2025-23209 | Vulnerability Database |
| CISA KEV Catalog Entry | US Government |
| Rapid7 ETR — CVE-2025-23209 Craft CMS Code Injection | Security Research |