CVE-2025-57811: Craft CMS Potential Remote Code Execution via Twig SSTI
Craft CMS Potential Remote Code Execution via Twig SSTI
Other sources
Craft is a platform for creating digital experiences. From versions 4.0.0-RC1 to 4.16.5 and 5.0.0-RC1 to 5.8.6, there is a potential remote code execution vulnerability via Twig SSTI (Server-Side Template Injection). This is a follow-up to CVE-2024-52293. This vulnerability has been patched in versions 4.16.6 and 5.8.7.
— MITRE
Note that users must have administrator access to the Craft Control Panel, and allowAdminChanges must be enabled for this to work, which is against Craft CMS' recommendations for any non-dev environment.
https://craftcms.com/knowledge-base/securing-craft#set-allowAdminChanges-to-false-in-production
Note: This is a follow-up to GHSA-f3cw-hg6r-chfv
Users should update to the patched versions (4.16.6 and 5.8.7) to mitigate the issue.
Resources: https://github.com/craftcms/cms/pull/17612
— GitHub
You must have administrator access, and ALLOWADMINCHANGES must be enabled for this to work.
https://craftcms.com/knowledge-base/securing-craft#set-allowAdminChanges-to-false-in-production
Note: This is a follow-up to GHSA-f3cw-hg6r-chfv
Users should update to the patched versions (4.16.6 and 5.8.7) to mitigate the issue.
References: https://github.com/craftcms/cms/pull/17612
— GitHub
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/craftcms/cmsto a version that resolves this vulnerability.Fixed in 5.8.7 - Upgrade
Upgrade
composer/craftcms/cmsto a version that resolves this vulnerability.Fixed in 4.16.6 - Upgrade
Upgrade
Craft CMSto a version that resolves this vulnerability.Fixed in 4.16.6 - Upgrade
Upgrade
Craft CMSto a version that resolves this vulnerability.Fixed in 5.8.7 - Configuration
Disable allowAdminChanges in production; the corresponding environment variable is ALLOW_ADMIN_CHANGES.
Craft CMS allowAdminChanges = false
Event History
Frequently Asked Questions
What is the severity of CVE-2025-57811?
The severity of CVE-2025-57811 is critical due to the potential for remote code execution.
How do I fix CVE-2025-57811?
To fix CVE-2025-57811, upgrade to a version of Craft CMS that is not vulnerable, specifically those beyond 5.8.6.
What versions are affected by CVE-2025-57811?
CVE-2025-57811 affects Craft CMS versions from 4.0.0-RC1 to 4.16.5 and 5.0.0-RC1 to 5.8.6.
What is the nature of the vulnerability in CVE-2025-57811?
CVE-2025-57811 is a remote code execution vulnerability caused by Server-Side Template Injection (SSTI) via Twig.
Is CVE-2025-57811 a follow-up to any previous vulnerabilities?
Yes, CVE-2025-57811 is a follow-up to CVE-2024-52293.