Improper Neutralization of Special Elements Used in a Template Engine in Grav CMS - CVE-2025-66294

 

Improper Neutralization of Special Elements Used in a Template Engine in Grav CMS - CVE-2025-66294

Published: May 5, 2026


Vulnerability identifier: #VU130066
CSH Severity: Medium
CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U/U:Green
CVE-ID: CVE-2025-66294
CWE-ID: CWE-1336
Exploitation vector: Remote access
Exploit availability: No public exploit available
Vendor: Grav CMS
Affected software:
Grav CMS

Detailed vulnerability description

The vulnerability allows a remote user to execute arbitrary commands on the server.

The vulnerability exists due to improper neutralization of special elements used in a template engine in the cleanDangerousTwig method when processing user-supplied Twig expressions through form message handling. A remote user can submit a specially crafted Twig payload to execute arbitrary commands on the server.

Exploitation in the documented editor scenario requires the official Form and Admin plugins and was demonstrated by chaining with a separate broken access control issue to modify the form process section. It may also be exploitable without authentication if a form already exists that accepts user input and passes it through evaluate_twig.


How to mitigate CVE-2025-66294

Install security update from vendor's website.

Sources