Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain page-write credentials
-
DeliveryAuthenticate to Grav admin/API
-
ExploitEmbed crafted Twig |sort payload in page frontmatter
-
ExecutionTrigger Email plugin or Twig rendering
-
Persistspl_autoload resolves and includes attacker-controlled PHP file
-
ImpactArbitrary code executes as web server user
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 | Exploitation requires an authenticated session with the admin.pages or api.pages.write permission on the target Grav instance-these are the roles assigned to content editors who can create or modify pages. The attacker must control content that is subsequently rendered by Grav's Twig engine; the advisory identifies form frontmatter processed by the Email plugin as a confirmed delivery path, but any Twig rendering surface accepting user-supplied |sort callables is potentially exploitable. No elevated network position (e.g., LAN adjacency) is required-only HTTPS access to the Grav admin or API endpoint. Exploitation is bounded by the authentication requirement: unauthenticated attackers cannot trigger the flaw directly. The minimum foothold is a valid low-privilege page-write account, which constrains the realistic threat population to insiders, compromised credentials, or attackers who have already achieved authenticated access through another vector. |
| Impact | The CVSS 4.0 vector supplied in the input (PR:N/UI:N/VC:H/VI:N/VA:N) materially misrepresents the exploitation requirements: the description is unambiguous that a valid authenticated account with page-write permissions (admin.pages or api.pages.write) is mandatory, and the impact is full RCE-not confidentiality-only. This vector should not be used for prioritization decisions. The real-world risk remains substantial: page-write roles are routinely granted to content contributors and site editors, meaning the attacker population includes any insider or individual who has obtained low-privilege credentials. The pivot from content-editor to shell access is a severe privilege escalation. No public exploit code has been identified, and the vulnerability is absent from CISA KEV, which moderates immediate urgency; however, the GitHub security advisory GHSA-p6qj-p5m7-f62h provides sufficient technical detail that a working exploit could be developed with modest effort, and even a mid-sized municipal IT team in sanok running a multi-editor Grav deployment should treat patching as urgent rather than deferring to compensating controls. EPSS data was not provided, preventing quantitative exploitation-probability assessment. |
| Exploit ScenarioDerived | An attacker authenticates to Grav with a content-editor account (admin.pages permission), then creates or modifies a page whose form frontmatter contains a crafted Twig template that invokes the |sort filter with spl_autoload as the sort callback. When the Email plugin (or another Twig rendering path) processes the page, spl_autoload is called with an attacker-controlled class name, causing PHP to include an attacker-accessible file on the server and execute its contents as the web server user. No public exploit code has been identified, but the advisory's technical specificity makes this scenario straightforward to implement. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 04, 2026
Remote code execution in Grav CMS (versions ≤2.0.17) lets authenticated users holding only page-write rights achieve arbitrary PHP execution on the web server by exploiting a Twig sandbox bypass in the |sort filter. The sortFunc wrapper in GravExtension.php incorrectly hardcodes isSandboxed=false-unlike |map, |filter, and |reduce-allowing |sort to resolve plain PHP callable names including spl_autoload, which is absent from the function denylist and performs a PHP include operation. A content editor can deliver a crafted payload through mechanisms such as form frontmatter rendered by the Email plugin, resulting in code execution as the web server user. A vendor-released patch is available in version 2.0.19, and no active exploitation appears in CISA KEV at time of analysis.
RemediationAI
Upgrade Grav to version 2.0.19 or later; this release corrects the isSandboxed argument in sortFunc and closes the spl_autoload denylist gap. The vendor advisory is at https://github.com/getgrav/grav/security/advisories/GHSA-p6qj-p5m7-f62h. If an immediate upgrade cannot be performed, restrict admin.pages and api.pages.write permissions exclusively to fully trusted accounts and revoke them from general content contributors-this directly narrows the attacker population but does not eliminate the vulnerability. Disabling the Email plugin removes the documented form-frontmatter rendering vector, though other Twig rendering paths may remain exploitable, making plugin removal an incomplete standalone control. Additionally, placing the Grav admin interface behind IP allowlisting or a VPN reduces exposure of the authentication endpoint to the broader internet, limiting opportunistic credential-stuffing attacks that could reach the vulnerable functionality.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in 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 PHP CMS that uses the Twig templating engine with a sandbox layer to restrict callable functions in user-supplied templates. GravExtension.php registers several custom Twig filters (|sort, |map, |filter, |reduce); however, the sortFunc callable-resolution wrapper passes isSandboxed=false to Twig's internal check, fully bypassing the sandbox enforcement that the other three filters correctly apply. This design flaw means |sort will resolve and invoke any PHP callable name that a template author supplies. The secondary control-a function denylist-fails to enumerate spl_autoload, an SPL standard-library function that resolves a class name to a file path and performs a PHP include, effectively loading arbitrary PHP from disk. CWE-94 (Improper Control of Generation of Code) accurately describes the root cause: user-controlled input reaches PHP's code-loading mechanism without proper sanitization or allowlisting. The affected product is identified by CPE cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:* covering all releases through 2.0.17.
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
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Requires low-privilege authenticated access (page-write role); RCE as web server user crosses into OS scope, yielding full C/I/A impact and a scope change.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
Grav before 2.0.19 (affected versions <= 2.0.17) contains a remote code execution vulnerability in the Twig sort filter. The sortFunc wrapper in GravExtension.php hardcodes Twig's isSandboxed argument to false, so unlike |map/|filter/|reduce, |sort accepts a plain function name inside the sandbox; the remaining denylist misses spl_autoload, which performs a PHP include. An authenticated user with only page-write rights (admin.pages or api.pages.write) can supply a crafted payload (e.g., via form frontmatter rendered by the Email plugin) that invokes spl_autoload through the sort filter, resulting in arbitrary PHP execution as the web server user.
Technical POC Analysis
CWE-94: the Grav Twig sandbox can be bypassed, letting page editors execute PHP code through the |sort filter.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
Grav CMS deployments running version 2.0.17 or earlier contain a remote code execution vulnerability exploitable by page editors, allowing attackers holding standard content-editing permissions to execute arbitrary code on web servers and compromise the entire content management platform. This directly threatens organizations relying on Grav to manage critical web properties and customer-facing content.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
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.
Server-side template injection (SSTI) in Grav (getgrav/grav) prior to 1.8.0-beta.27 allows an authenticated attacker hol
Broken access control in Grav CMS (CWE-285) before 1.8.0-beta.27 lets an authenticated editor-level user escalate their
A Remote Code Execution (RCE) vulnerability in Grav CMS v1.7.48 allows an authenticated admin to upload a malicious plug
Grav is a file-based Web platform. Rated critical severity (CVSS 9.9), this vulnerability is remotely exploitable, low a
GravCMS 1.10.7 allows unauthenticated remote attackers to write arbitrary YAML configuration files, leading to full serv
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
Remote code execution in Grav CMS before 2.0.15 allows attackers holding page-edit or blueprint-config privileges to wri
Vertical privilege escalation in Grav CMS before 2.0.14 lets a delegated administrator holding only the admin.users perm
Stored cross-site scripting in Grav CMS before 2.0.15 lets authenticated editors smuggle JavaScript event handlers past
Server-side request forgery (SSRF) in Grav CMS versions prior to 1.7.49.5 allows remote authenticated attackers to make
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, Grav CMS is vulnerable to a Server-Side Template Injection (S
Remote code execution in Grav CMS before 2.0.13 allows authenticated low-privilege users to plant and execute arbitrary
EUVD-2026-71027
GHSA-ggph-mfjj-69jr
NVD
CVE.org
EPSS
VulDB
Exploit-DB