Skip to main content

Grav CVE-2025-66294

| EUVDEUVD-2025-200081 HIGH
Code Injection (CWE-94)
2025-12-01 security-advisories@github.com GHSA-662m-56v4-3r8f
8.7
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain editor account or locate public evaluate_twig form
  2. Delivery
    Submit crafted Twig with nested function calls
  3. Exploit
    Bypass cleanDangerousTwig regex sanitization
  4. Execution
    Execute arbitrary PHP/OS commands as web user
  5. Impact
    Full server compromise

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Primary path requires an authenticated account with Grav editor (pages) permissions plus the official Form and Admin plugins installed; the attacker creates or edits a form with a 'message' process action whose value is passed to Twig processString/cleanDangerousTwig, and uses nested function calls (e.g. via evaluate/evaluate_twig) to bypass the weak sanitization regex. A secondary, more limited unauthenticated path is possible ONLY when a form already exists that accepts user input and feeds it through evaluate_twig. Limiting factors: default editor-privilege requirement (PR:L), dependence on the Form/Admin plugins, and - for the guest case - a pre-existing vulnerable form configuration. Fixed in 1.8.0-beta.27.

Impact

This is a genuine high-priority vulnerability, not a paper CVSS score. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H, base 8.7) describes network-reachable, low-complexity code execution with full confidentiality/integrity/availability impact requiring only low privileges (an 'editor' account). The signals reinforce each other rather than conflict: EPSS is 38.34% (97th percentile) - exceptionally high and consistent with the publicly available exploit code in the GHSA advisory and the confirmed vendor patch commit. Publicly available exploit code exists, but this is NOT confirmed active exploitation - the CVE is not listed in CISA KEV, so treat it as high exploitation *likelihood* rather than proven in-the-wild use. One nuance to verify: the CVSS PR:L reflects the primary editor-authenticated path, but both the description and GHSA advisory state that under certain conditions (a pre-existing form that feeds user input through evaluate_twig) an *unauthenticated* attacker can also achieve RCE - meaning realistic worst-case risk exceeds the PR:L-based score for some deployments. The root cause (weak regex in cleanDangerousTwig / Twig sandbox bypass) is confirmed by the source diff. Overall: real priority, patch urgently.

Exploit ScenarioDerived

An attacker with a low-privileged Grav editor account (or, where a public form already routes submitted input through evaluate_twig, an unauthenticated visitor) crafts a Twig payload using nested function calls that slip past the cleanDangerousTwig regex, achieving server-side template injection and arbitrary command execution as the web server user. Publicly available exploit code and a detailed write-up exist in the GHSA-662m-56v4-3r8f advisory, lowering the barrier to weaponization.

Act Now Prioritize within 24-48h. Why: HIGH severity + EPSS > 10%.
Patch available 38.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Sep 26, 2026

Server-side template injection (SSTI) in Grav (getgrav/grav) prior to 1.8.0-beta.27 allows an authenticated attacker holding Grav editor (pages) permissions to break out of the Twig sandbox and execute arbitrary commands on the web server, escalating to full host compromise. The exploitable path requires the official Form and Admin plugins: an editor crafts or edits a form whose 'message' process action is passed to Twig's processString/cleanDangerousTwig, then uses nested function calls (for example through evaluate/evaluate_twig) to defeat the weak denylist regex; a narrower unauthenticated path exists only when a pre-existing form already feeds guest-supplied input through evaluate_twig. Publicly available exploit code exists, EPSS is elevated at 38.34% (97th percentile), and the flaw is fixed in 1.8.0-beta.27.

Earlier versions of this analysis (1)
v1 Mar 15, 2026 - 13:34 CVSS 8.8

RemediationAI

Upgrade Grav to 1.8.0-beta.27 or later - this is the vendor-released patch and it addresses the sanitizer directly (fix commit https://github.com/getgrav/grav/commit/e37259527d9c1deb6200f8967197a9fa587c6458, advisory https://github.com/getgrav/grav/security/advisories/GHSA-662m-56v4-3r8f). Because the flaw can also be reached through any code that indirectly calls cleanDangerousTwig via Twig::processString, patching is the only complete fix. If immediate upgrade is not possible, apply compensating controls with their trade-offs in mind: revoke editor/pages-level accounts from untrusted users and restrict the Admin plugin to a trusted, network-restricted group (this is the most effective stopgap since the primary path is authenticated, but it degrades editorial workflow for any untrusted content contributors); audit and remove or harden any form definitions that use a 'message' process action or that pass user-supplied input into evaluate_twig (removing evaluate/evaluate_twig usage from forms eliminates the guest-facing path but breaks legitimate dynamic form messaging); and, where content editing is already trusted, treat the site as fully trusted-host-only rather than relying on the regex sanitizer. Note that because the vulnerable versions include the 1.8.0 beta line, environments already on a 1.8.0 beta must move specifically to beta.27 or newer, and stable-line sites must confirm they are on a build that incorporates this fix rather than assuming a 1.7.x release does.

Affected VersionsENISA

grav < 1.8.0-beta.27

Affected Packages

composer getgrav/grav fix: 1.8.0-beta.27
euvd grav fix: 1.8.0-beta.27

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Grav is a flat-file (file-based) PHP web platform that renders pages and forms through Twig, PHP's template engine. The affected component is the cleanDangerousTwig() sanitizer in system/src/Grav/Common/Security.php, which is invoked whenever untrusted strings are passed to Twig::processString() - for example by the Form plugin's 'message' process action. The sanitizer relied on a hand-written regular expression denylist and failed to account for nested function calls, so a value such as a crafted message action could reach the Twig evaluate/evaluate_twig facilities and execute arbitrary PHP, the classic CWE-94 (Improper Control of Generation of Code / Code Injection) pattern in which data is interpreted as code. The upstream fix (commit e37259527d9c1deb6200f8967197a9fa587c6458) replaces the naive check with cached, compiled regex patterns that cover dangerous Twig functions and internals (call_user_func, exec, system, file/stream operations, Reflection, unserialize, curl/socket, Twig runtime and escaper manipulation), dangerous property and method access (config.set, grav.scheduler, core.setEscaper, user update/save, cache purge, GPM/backup access), bare dangerous function calls outside Twig blocks, and a dedicated pattern that detects string-concatenation plus |join fragment-assembly bypasses of the denylist.

Know when Grav gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 8.7 HIGH
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
vuln.today AI 8.8 HIGH

Network-reachable Twig injection needing only a low-privileged editor account and no interaction yields full RCE, so PR:L, AC:L, UI:N and C/I/A:H.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

5
CVSS changed
Sep 26, 2026 - 00:22 NVD
8.8 (HIGH) 8.7 (HIGH)
Patch released
Mar 15, 2026 - 13:34 nvd
Patch available
PoC Detected
Dec 04, 2025 - 18:36 vuln.today
Public exploit code
CVE Published
Dec 01, 2025 - 21:15 cve.org
HIGH 8.7
CVE Published
Dec 01, 2025 - 21:15 nvd
HIGH 8.8

DescriptionCVE.org

Grav is a file-based Web platform. Prior to 1.8.0-beta.27, a Server-Side Template Injection (SSTI) vulnerability exists in Grav that allows authenticated attackers with editor permissions to execute arbitrary commands on the server and, under certain conditions, may also be exploited by unauthenticated attackers. This vulnerability stems from weak regex validation in the cleanDangerousTwig method. This vulnerability is fixed in 1.8.0-beta.27.

Executive ViewAI

Why It Matters

A critical Server-Side Template Injection vulnerability in Grav CMS (CVE-2025-66294) allows authenticated editors and potentially unauthenticated attackers to execute arbitrary commands on affected servers. Organizations running Grav versions prior to 1.8.0-beta.27 face immediate risk of system compromise, data exfiltration, and operational disruption, particularly if the CMS is internet-facing or manages sensitive content.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching is not feasible: implement Web Application Firewall (WAF) rules to block requests containing template injection patterns ({{, {%, twig syntax); disable public editor/registration functionality; restrict admin/editor access to whitelisted IP addresses; monitor server logs for execution of suspicious commands; consider taking affected Grav instances offline until patching is complete.

Threat Intelligence Overview

Threat Score
4.4/10
Composite threat intelligence
EPSS Score
38.3%
Top 3% exploitable
Prevalence
Medium
popular open-source flat-file CMS, but far smaller footprint than WordPress
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 38.3%
Patch available Yes
Active threat Yes
Deciding rule
HIGH severity + EPSS > 10%
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Active
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

117
Low Medium High Critical
KEV: 0
EPSS: +38
CVSS: +44
PoC: +20
Weaponized: +15
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in Grav

View all
CVE-2025-50286 HIGH POC
8.1 Aug 06

A Remote Code Execution (RCE) vulnerability in Grav CMS v1.7.48 allows an authenticated admin to upload a malicious plug

CVE-2024-34082 CRITICAL POC
9.9 May 15

Grav is a file-based Web platform. Rated critical severity (CVSS 9.9), this vulnerability is remotely exploitable, low a

CVE-2021-47812 CRITICAL POC
9.8 Jan 16

GravCMS 1.10.7 allows unauthenticated remote attackers to write arbitrary YAML configuration files, leading to full serv

CVE-2026-65008 CRITICAL POC
9.3 Jul 21

Remote code execution in Grav CMS 2.0.4 (fixed in 2.0.7) lets an authenticated user holding the admin.pages or api.pages

CVE-2026-75827 CRITICAL POC
9.3 Aug 18

Remote code execution in Grav CMS before 2.0.15 allows attackers holding page-edit or blueprint-config privileges to wri

CVE-2026-75837 CRITICAL POC
9.3 Aug 18

Vertical privilege escalation in Grav CMS before 2.0.14 lets a delegated administrator holding only the admin.users perm

CVE-2026-75828 CRITICAL POC
9.3 Aug 18

Stored cross-site scripting in Grav CMS before 2.0.15 lets authenticated editors smuggle JavaScript event handlers past

CVE-2025-66844 CRITICAL POC
9.1 Dec 15

Server-side request forgery (SSRF) in Grav CMS versions prior to 1.7.49.5 allows remote authenticated attackers to make

CVE-2026-72819 HIGH POC
8.7 Aug 14

Remote code execution in Grav CMS before 2.0.13 allows authenticated low-privilege users to plant and execute arbitrary

CVE-2024-28119 HIGH POC
8.8 Mar 21

Grav is an open-source, flat-file content management system. Rated high severity (CVSS 8.8), this vulnerability is remot

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy