{"schemaVersion":3,"id":"CVE-2025-66294","aliases":[],"status":"published","duplicateOf":null,"title":null,"description":"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.","dates":{"published":"2025-12-01T20:52:08.533Z","modified":"2025-12-02T14:05:20.675Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":8.8,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"4.0","versionLabel":"v4.0","source":"CVE.org","score":8.7,"severity":"high","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","exploitability":null,"impact":null,"computed":false},{"version":"4.0","versionLabel":"v4.0","source":"NVD","score":8.7,"severity":"high","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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.02818,"percentile":0.86376,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.02818},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.02818,"percentile":0.86376}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.02818,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.02818,"percentile":0.86376}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"GITHUB_GETGRAV_GRAV","name":"Grav","source":"github","url":"https://github.com/getgrav/grav/security/advisories/GHSA-w48r-jppp-rcfw","maturity":"poc","reliabilityScore":0.3,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null},{"id":"MSF_EXPLOIT_MULTI_HTTP_GRAV_TWIG_SSTI_SANDBOX_BYPASS_RCE","name":"Grav CMS Twig SSTI Authenticated Sandbox Bypass RCE","source":"metasploit","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploit/multi/http/grav_twig_ssti_sandbox_bypass_rce.rb","maturity":"weaponized","reliabilityScore":1,"verified":true,"type":"remote","platforms":[],"requiresAuth":true,"exploitdb":null,"metasploit":{"fullname":"exploit/multi/http/grav_twig_ssti_sandbox_bypass_rce","rank":"600","rankName":"excellent","postAuth":true,"check":true,"stability":["crash-safe"],"sideEffects":["ioc-in-logs"],"reliability":["repeatable-session"]}}],"exploitCount":2,"weaknesses":[{"id":"CWE-94","name":"Improper Control of Generation of Code ('Code Injection')","description":"The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"Medium","url":"https://cwe.mitre.org/data/definitions/94.html"},{"id":"CWE-1336","name":"Improper Neutralization of Special Elements Used in a Template Engine","description":"The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.","type":"weakness","status":"Incomplete","abstraction":"Base","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/1336.html"}],"affected":[{"vendor":"getgrav","product":"grav","name":"grav","label":"grav","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 1.8.0-beta.27","noFixRecorded":false,"fixedIn":null},{"text":"≥ 1.7.48, < 1.8.0","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta1","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta10","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta11","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta12","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta13","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta14","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta15","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta16","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta17","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta18","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta19","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta2","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta20","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta21","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta22","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta23","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta24","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta25","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta26","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta3","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta4","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta5","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta6","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta7","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta8","noFixRecorded":false,"fixedIn":null},{"text":"1.8.0:beta9","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.8.0-beta.27 | ≥ 1.7.48, < 1.8.0 | 1.8.0:beta1 | 1.8.0:beta10 | 1.8.0:beta11 | 1.8.0:beta12 | 1.8.0:beta13 | 1.8.0:beta14 | 1.8.0:beta15 | 1.8.0:beta16 | 1.8.0:beta17 | 1.8.0:beta18 | 1.8.0:beta19 | 1.8.0:beta2 | 1.8.0:beta20 | 1.8.0:beta21 | 1.8.0:beta22 | 1.8.0:beta23 | 1.8.0:beta24 | 1.8.0:beta25 | 1.8.0:beta26 | 1.8.0:beta3 | 1.8.0:beta4 | 1.8.0:beta5 | 1.8.0:beta6 | 1.8.0:beta7 | 1.8.0:beta8 | 1.8.0:beta9","eol":null,"hubHref":"/vendor/getgrav/grav"}],"affectedCount":1,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-662m-56v4-3r8f","label":"github.com/getgrav/grav/security/advisories/GHSA-662m-56v4-3r8f","hostname":"github.com","tags":["X Refsource CONFIRM","Exploit","Vendor Advisory"]},{"url":"https://github.com/getgrav/grav/commit/e37259527d9c1deb6200f8967197a9fa587c6458","label":"github.com/getgrav/grav/commit/e37259527d9c1deb6200f8967197a9fa587c6458","hostname":"github.com","tags":["X Refsource MISC","Patch"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2025-12-01T20:52:08.533Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2025-12-02T14:05:20.675Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":46,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-21T00:32:57.628Z","stale":false,"partial":false}}