CVE-2025-66294: Grav is vulnerable to RCE via SSTI through Twig Sandbox Bypass
CVE-2025-66294 · Severity: high · CVSS 8.8 · Published 2025-12-01
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.
Yes. getgrav/grav (Packagist): upgrade to 1.8.0-beta.27 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
Am I affected by CVE-2025-66294?
Check whether you run getgrav/grav (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
getgrav/grav (Packagist): upgrade to 1.8.0-beta.27 or later