CVE-2025-46731: Craft CMS Remote Code Execution Vulnerability via Twig SSTI

craftcms/cms Updated 14 Dec 2025

Summary

05/05/2025
Yes i
High
7.3

CVE-2025-46731: Craft CMS Contains a Potential Remote Code Execution Vulnerability via Twig SSTI. Affects craftcms/cms across 2 version ranges.

>= 4.0.0-RC1, < 4.14.13 >= 5.0.0-RC1, < 5.6.15

Fixed in 4.14.13 or 5.6.15, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Craft CMS is a flexible content management system that allows developers to create and manage websites with ease. It offers features such as custom fields, a powerful templating engine, and a user-friendly interface. However, it has been found to contain a potential remote code execution vulnerability due to server-side template injection (SSTI) in its Twig templating engine, which can be exploited if certain conditions are met.

Vulnerability Detail

Craft CMS contains a potential remote code execution vulnerability via Twig SSTI. This vulnerability arises when an attacker with administrator access can exploit the system if the 'ALLOW_ADMIN_CHANGES' setting is enabled. This could lead to unauthorized execution of arbitrary code on the server, compromising the integrity and security of the application. The vulnerability is particularly critical as it allows for high-level access to the server, which can result in data breaches or further exploitation.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 4.0.0-RC1, < 4.14.13 4.14.13
    composer require craftcms/cms:4.14.13
  • >= 5.0.0-RC1, < 5.6.15 5.6.15
    composer require craftcms/cms:5.6.15

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, it is recommended to set the 'ALLOW_ADMIN_CHANGES' configuration to false in your production environment. This can be done by modifying the configuration file as follows: '

define('ALLOW_ADMIN_CHANGES', false);

'. This will prevent any changes from being made by administrators until the patch is applied.

Conclusion

The Craft CMS vulnerability identified as CVE-2025-46731 poses a significant risk due to its potential for remote code execution via Twig SSTI. Users are urged to update to the latest patched versions to secure their applications. Implementing the recommended workarounds can provide temporary relief until the update is completed.

See every vulnerability recorded for craftcms/cms →

Share this vulnerability

FAQ

The vulnerability is a potential remote code execution flaw that can be exploited via server-side template injection in Craft CMS.

Any Craft CMS installation that has administrator access and has 'ALLOW_ADMIN_CHANGES' enabled is at risk.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without any signup.

As a temporary measure, disable the 'ALLOW_ADMIN_CHANGES' setting in your configuration to prevent exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for craftcms/cms.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 4.0.0-RC1, < 4.14.13 4.14.13
    composer require craftcms/cms:4.14.13
  • >= 5.0.0-RC1, < 5.6.15 5.6.15
    composer require craftcms/cms:5.6.15

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback