Skip to main content

Grav CMS CVE-2025-66297

| EUVDEUVD-2025-200078 HIGH
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2025-12-01 security-advisories@github.com GHSA-858q-77wx-hhx6
7.4
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

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

  1. Access
    Authenticate as low-priv page editor
  2. Delivery
    Enable Twig processing in page frontmatter
  3. Exploit
    Inject malicious Twig expressions
  4. Execution
    Visit page to render payload
  5. Impact
    Escalate to super admin or run commands via scheduler API

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
Exploitation Conditions

Requires an authenticated Grav account with admin panel access and page create/edit permission (admin.pages), such as a publisher or editor role - it is NOT exploitable by anonymous/unauthenticated users. The attacker must be able to enable Twig processing on a page (Advanced -> Process: Twig: true), which is not the default page setting but can be toggled by the page editor themselves. Because the Twig sandbox is not enforced in the page-render context, injected expressions gain full access to backend PHP objects under system/src/Grav/Common, enabling grav.user.update()/save() for privilege escalation and grav.scheduler.addCommand()/save()/run() for RCE. Limiting factor: the editor role must be a real trust boundary in the deployment; on single-admin installs the impact is negligible. For the privilege-escalation path specifically, the attacker must also be logged into the front-end site with the same account.

Impact

This is a genuine but access-gated risk. The official CVSS 4.0 vector (AV:N/AC:L/PR:L/UI:N/VC:H/VI:H/VA:H, base 7.4) and the GitHub advisory both confirm exploitation requires an authenticated Grav user who already holds admin panel access with page create/edit rights (admin.pages) - so this is NOT unauthenticated internet-wide RCE. The E:P flag in the vector aligns with the input signal that a full PoC is publicly available (GHSA-858q-77wx-hhx6 contains working privesc and RCE payloads), which raises operational risk for any environment where low-trust editors/publishers exist. EPSS is modest at 0.40% (60th percentile), and there is NO CISA KEV listing, indicating no confirmed mass exploitation - consistent with a vuln that requires prior authenticated foothold rather than one favored by opportunistic scanners. Net: real priority for multi-user Grav deployments that delegate page-editing to semi-trusted users (the flaw lets such a user become super admin and run OS commands), but lower urgency for single-admin installs where the editor already effectively controls the site. The signals are internally consistent - no conflicts to flag - the main caveat is that impact assumes the editor role is a meaningful trust boundary in the target deployment.

Exploit ScenarioDerived

A publisher/editor with page-editing rights but no admin privileges logs into the Grav admin panel, creates or edits a page, and enables Twig processing (process: twig: true) in the frontmatter. They inject Twig calling grav.user.update()/save() to flip their own account to super admin, or grav.scheduler.addCommand()/save()/run() to execute arbitrary OS commands, then simply visit the page to trigger rendering. A public PoC with both payloads exists in the GitHub Security Advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

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

Alert me

AnalysisAIv2 – Sep 26, 2026

Privilege escalation and authenticated remote code execution in Grav CMS versions prior to 1.8.0-beta.27 let an admin-panel user with page create/edit rights enable Twig processing in page frontmatter and inject expressions that reach the entire backend PHP object graph. Because the Twig sandbox is not enforced in the page-render context, a publisher or editor-level account can call grav.user.update()/save() to promote itself to admin/super-admin, or chain grav.scheduler.addCommand()/save()/run() to execute arbitrary system commands; publicly available exploit code exists, with a working payload published in the GHSA-858q-77wx-hhx6 advisory. The attack is access-gated rather than unauth-remote - it requires a valid authenticated account with admin.pages permission (CVSS vector PR:L), and the privilege-escalation path additionally requires the attacker to be logged into the front-end site with that same account. EPSS is low at 0.40% (60th percentile), consistent with a genuine but niche, insider-adjacent risk rather than mass exploitation.

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

RemediationAI

Upgrade to Grav 1.8.0-beta.27 or later - vendor-released patch, delivered through the composer/getgrav/grav package - which adds the Twig blocklist hardening in system/src/Grav/Common/Security.php via commit e37259527d9c1deb6200f8967197a9fa587c6458; full details are in advisory GHSA-858q-77wx-hhx6. Because the fix is a deny-list/pattern filter rather than enforced sandboxing, treat any account that can edit page frontmatter as a privileged operator: review users and roles, strip admin.pages from publisher/editor accounts that do not genuinely need it (this breaks normal editorial workflow for those users, so reassign content duties first), and consider revoking the front-end login path for such accounts since the privilege-escalation chain needs a concurrent site session with the same user. As a hardening measure, disallow 'process: twig: true' in page frontmatter by policy or a blueprint/config restriction, and audit existing pages for that flag - the trade-off is loss of in-content Twig templating for legitimate authors. Where the Scheduler API is not needed for business workflows, remove or lock down scheduler jobs/config so the RCE chain's addCommand()/save()/run() sink is unavailable, and where it is needed, alert on unexpected job creation by non-administrators. Restrict admin panel exposure to trusted networks or an SSO/reverse-proxy gate to raise the cost of credential-based initial access. Note the publicly available PoC and low EPSS (0.40%, 60th percentile): prioritize patching where multiple non-admin editors exist or the admin panel is internet-reachable.

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

The root cause class is CWE-1336, improper neutralization of special elements used in a template engine, i.e. server-side template injection in Twig. Grav is a flat-file PHP CMS whose pages can opt into template evaluation by setting 'process: twig: true' in the page frontmatter (togglable from the admin panel under Advanced), after which the page body is compiled and rendered as a Twig template. In that render context the Twig sandbox/security policy is not applied, so template variables such as {{ grav.* }} expose live Grav service objects under system/src/Grav/Common - the User/Accounts API and the Scheduler API in particular - along with their public methods, giving an attacker object-graph access equivalent to in-process PHP code. The upstream fix in commit e37259527d9c1deb6200f8967197a9fa587c6458 hardens Grav\Common\Security.php by compiling cached regex blocklists that flag dangerous Twig functions (eval, system, exec, file_put_contents, curl_*, ReflectionClass, include/require, unserialize, etc.), dangerous property/method patterns (grav.user.update/save, grav.scheduler.*, config.set, twig.addFilter/Extension, core.setEscaper, _context, locator.findResource with write mode), calls outside Twig blocks used for nested evaluation, and array-index/join concatenation tricks that would reassemble a blocked function name at runtime. Notably this is a deny-list and pattern-matching defense layered on the existing rendering path rather than true sandbox enforcement, which is why deployments should not treat the beta patch as equivalent to isolating untrusted template authors.

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 7.4 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/E:P
vuln.today AI 8.8 HIGH

Remotely reachable admin panel (AV:N/AC:L); requires an authenticated non-admin page editor (PR:L); attacker triggers by visiting own page so no other-user interaction (UI:N); Twig-to-PHP RCE yields full C/I/A.

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) 7.4 (HIGH)
Patch released
Mar 15, 2026 - 13:34 nvd
Patch available
PoC Detected
Dec 03, 2025 - 15:58 vuln.today
Public exploit code
CVE Published
Dec 01, 2025 - 21:15 cve.org
HIGH 7.4
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 user with admin panel access and permissions to create or edit pages in Grav CMS can enable Twig processing in the page frontmatter. By injecting malicious Twig expressions, the user can escalate their privileges to admin or execute arbitrary system commands via the scheduler API. This results in both Privilege Escalation (PE) and Remote Code Execution (RCE) vulnerabilities. This vulnerability is fixed in 1.8.0-beta.27.

Executive ViewAI

Why It Matters

Grav CMS instances running versions prior to 1.8.0-beta.27 are vulnerable to privilege escalation and remote code execution if admin users with page editing permissions are compromised or act maliciously. An attacker exploiting this vulnerability could gain full system control, potentially leading to data theft, service disruption, and compliance violations.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 40% exploitable
Prevalence
Medium
popular open-source flat-file PHP CMS, sizable but sub-WordPress footprint
Exploit
POC
Public exploit code exists
Data Quality
5 sources
Confidence: Medium

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 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
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
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

57
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +37
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

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

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