{"id":"CVE-2025-66294","published":"2025-12-01T20:52:08Z","modified":"2025-12-02T14:05:20Z","title":"Grav is vulnerable to RCE via SSTI through Twig Sandbox Bypass","vendor":"getgrav","product":"grav","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.7,"severity":"HIGH","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.03044,"percentile":0.87849,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-1336","name":"Improper Neutralization of Special Elements Used in a Template Engine"}],"references":[{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-662m-56v4-3r8f","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/getgrav/grav/commit/e37259527d9c1deb6200f8967197a9fa587c6458","tags":["x_refsource_MISC"]}],"priority":{"score":28.7,"factors":[{"name":"EPSS percentile","points":17.57},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":6.09}]},"exploitSources":{"metasploit":[{"name":"Grav CMS Twig SSTI Authenticated Sandbox Bypass RCE","module":"exploit/multi/http/grav_twig_ssti_sandbox_bypass_rce","type":"exploit","disclosureDate":"2025-12-01","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/grav_twig_ssti_sandbox_bypass_rce.rb"}],"first":{"date":"2025-12-01","source":"Metasploit","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/grav_twig_ssti_sandbox_bypass_rce.rb"},"provenance":"source"},"vendorSlug":"getgrav","affectedVersions":[{"vendor":"getgrav","product":"grav","versions":["< 1.8.0-beta.27"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2025-12-02T14:05:10.905709Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"getgrav/grav","vulnerableRanges":["<1.8.0-beta.27"],"patched":["1.8.0-beta.27"],"from":["GHSA-662m-56v4-3r8f"],"provenance":"source"}],"euvd":{"id":"EUVD-2025-200081","exploited":false,"provenance":"source"}}