CVE-2026-130744: Grav 2.0.0 before 2.2.18 RCE via Host Header Environment Folder
Grav from 2.0.0 before 2.2.18 contains a remote code execution vulnerability that allows page editors to escape the Twig sandbox by sending requests with a Host: pages header. Attackers can write configuration YAML through page folders and media .meta.yaml sidecars to register an unsandboxed Twig namespace and run shell commands as the web server user.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Gravto a version that resolves this vulnerability.Fixed in 2.2.18
Event History
Frequently Asked Questions
Who can exploit this issue?
An attacker needs page editor privileges in Grav. The attack is performed by sending requests with a Host header set to pages, so it can be carried out remotely by an authenticated editor without user interaction.
What access does successful exploitation provide?
Successful exploitation lets the attacker escape the Twig sandbox and execute shell commands as the web server user. This can affect confidentiality, integrity, and availability of resources accessible to that account.
Which installations are affected?
Grav versions from 2.0.0 up to, but not including, 2.2.18 are affected. Systems running 2.2.18 or later are not identified as affected by the provided information.