{"id":"CVE-2021-29440","published":"2021-04-13T19:55:13Z","modified":"2024-08-03T22:02:51Z","title":"Twig allowing dangerous PHP functions by default","vendor":"getgrav","product":"grav","tier":"tail","description":{"text":"Grav is a file based Web-platform. 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. The issue was addressed in version 1.7.11.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.4,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.29896,"percentile":0.98246,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-g8r4-p96j-xfxc","tags":["x_refsource_CONFIRM"]},{"url":"https://packagist.org/packages/getgrav/grav","tags":["x_refsource_MISC"]},{"url":"http://packetstormsecurity.com/files/162987/Grav-CMS-1.7.10-Server-Side-Template-Injection.html","tags":["x_refsource_MISC"]},{"url":"https://blog.sonarsource.com/grav-cms-code-execution-vulnerabilities","tags":["x_refsource_MISC"]}],"priority":{"score":30.5,"factors":[{"name":"EPSS percentile","points":19.65},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.88}]},"exploitSources":{"exploitdb":{"count":1,"earliest":"2021-06-07"},"pocGithub":{"count":1,"skipped":0,"earliest":"2021-06-06","earliestUrl":"https://github.com/CsEnox/CVE-2021-29440","repos":[{"name":"CsEnox/CVE-2021-29440","url":"https://github.com/CsEnox/CVE-2021-29440","stars":4,"created":"2021-06-06"}]},"first":{"date":"2021-06-06","source":"PoC-in-GitHub","url":"https://github.com/CsEnox/CVE-2021-29440"},"provenance":"source"},"vendorSlug":"getgrav","affectedVersions":[{"vendor":"getgrav","product":"grav","versions":["< 1.7.11"]}],"affected":[{"ecosystem":"Packagist","package":"getgrav/grav","vulnerableRanges":["<1.7.11"],"patched":["1.7.11"],"from":["GHSA-g8r4-p96j-xfxc"],"provenance":"source"}],"summary":{"text":"Grav, a file-based web platform from getgrav, has a flaw in its Twig processing of static pages, where Twig can be enabled through page front matter and runs unsandboxed. An attacker who holds administrative rights allowing them to create or edit pages (privileges are required, and user interaction is needed) can use this to execute arbitrary code and elevate privileges on the instance, with the attack reachable over the network.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T00:18:20Z"},"euvd":{"id":"EUVD-2021-0824","exploited":false,"provenance":"source"},"exploits":[{"id":49961,"url":"https://www.exploit-db.com/exploits/49961","title":"Grav CMS 1.7.10 - Authenticated Server-Side Template Injection (SSTI)","date":"2021-06-07","verified":false,"provenance":"source"}],"exploitRefs":["http://packetstormsecurity.com/files/162987/Grav-CMS-1.7.10-Server-Side-Template-Injection.html"],"lineage":{"packageHistory":[{"cve":"CVE-2020-29555","published":"2021-03-15","fixed":"1.6.30","kev":false},{"cve":"CVE-2020-29556","published":"2021-03-15","fixed":"1.6.30","kev":false},{"cve":"CVE-2019-16126","published":"2019-09-09","fixed":"1.7.0-beta.8","kev":false,"link":{"from":"CVE-2019-16126","to":"CVE-2021-29440","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:getgrav/grav","fromFixed":"1.7.0-beta.8","toFixed":"1.7.11","daysApart":582}]}},{"cve":"CVE-2021-29440","published":"2021-04-13","fixed":"1.7.11","kev":false},{"cve":"CVE-2021-3818","published":"2021-09-27","fixed":"1.7.21","kev":false,"link":{"from":"CVE-2021-29440","to":"CVE-2021-3818","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:getgrav/grav","fromFixed":"1.7.11","toFixed":"1.7.21","daysApart":167}]}},{"cve":"CVE-2021-3904","published":"2021-10-27","fixed":"1.7.24","kev":false},{"cve":"CVE-2022-0268","published":"2022-01-25","fixed":"1.7.28","kev":false}],"package":"Packagist:getgrav/grav"}}