{"id":"CVE-2024-28119","published":"2024-03-21T22:02:04Z","modified":"2024-08-21T22:55:01Z","title":"Grav vulnerable to Server Side Template Injection (SSTI) via Twig escape handler","vendor":"getgrav","product":"grav","tier":"tail","description":{"text":"Grav is an open-source, flat-file content management system. Prior to version 1.7.45, due to the unrestricted access to twig extension class from grav context, an attacker can redefine the escape function and execute arbitrary commands. Twig processing of static pages can be enabled in the front matter by any administrative user allowed to create or edit pages. As the Twig processor runs unsandboxed, this behavior can be used to gain arbitrary code execution and elevate privileges on the instance. Version 1.7.45 contains a patch for this issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01584,"percentile":0.76165,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-2m7x-c7px-hp58","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/getgrav/grav/commit/de1ccfa12dbcbf526104d68c1a6bc202a98698fe","tags":["x_refsource_MISC"]},{"url":"https://github.com/twigphp/Twig/blob/3.x/src/Extension/EscaperExtension.php#L99","tags":["x_refsource_MISC"]}],"priority":{"score":21.4,"factors":[{"name":"EPSS percentile","points":15.23},{"name":"CVSS severity","points":6.16}]},"vendorSlug":"getgrav","affectedVersions":[{"vendor":"getgrav","product":"grav","versions":["< 1.7.45"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2024-03-28T18:13:10.316112Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"getgrav/grav","vulnerableRanges":["<1.7.45"],"patched":["1.7.45"],"from":["GHSA-2m7x-c7px-hp58"],"provenance":"source"}],"summary":{"text":"Grav, the open-source flat-file content management system, contains a server-side template injection flaw in its Twig processing, where code reachable from the Grav context lets the escape handler be redefined; this affects versions before 1.7.45. An attacker who holds an administrative account permitted to create or edit pages can enable Twig processing on a static page through its front matter, and because that Twig processor runs unsandboxed, they can execute arbitrary commands and elevate privileges on the instance.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:59:17Z"},"euvd":{"id":"EUVD-2024-0788","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-getgrav-grav-cve-2024-28117","children":[{"from":"CVE-2024-28119","to":"CVE-2026-72820","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["system/src/Grav/Common/Twig/Twig.php"],"commits":["https://github.com/getgrav/grav/commit/de1ccfa12dbcbf526104d68c1a6bc202a98698fe","https://github.com/getgrav/grav/commit/ad9709f865b09b68798fb1ac375b484a8cc1d892"],"basis":"shared function","functions":["setTemplate"]}]},{"from":"CVE-2024-28119","to":"CVE-2026-72831","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["system/src/Grav/Common/Twig/Twig.php"],"commits":["https://github.com/getgrav/grav/commit/de1ccfa12dbcbf526104d68c1a6bc202a98698fe","https://github.com/getgrav/grav/commit/ad9709f865b09b68798fb1ac375b484a8cc1d892"],"basis":"shared function","functions":["setTemplate"]}]},{"from":"CVE-2024-28119","to":"CVE-2026-72832","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["system/src/Grav/Common/Twig/Twig.php"],"commits":["https://github.com/getgrav/grav/commit/de1ccfa12dbcbf526104d68c1a6bc202a98698fe","https://github.com/getgrav/grav/commit/ad9709f865b09b68798fb1ac375b484a8cc1d892"],"basis":"shared function","functions":["setTemplate"]}]}]}}