# CVE-2021-29440: Twig allowing dangerous PHP functions by default

- Severity: High 8.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 29.9%, higher than 98% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2021-04-13T19:55:13.000Z
- Modified: 2026-06-17T03:47:38.757Z
- Also known as: GHSA-g8r4-p96j-xfxc
- Weaknesses: CWE-94
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- getgrav grav: < 1.7.11; before 1.7.11
- getgrav/grav (Packagist): before 1.7.11

## Every score

- GitHub_M: CVSS:3.1 8.4 High `CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H`
- GitHub: CVSS:3.1 8.4 High `CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.2 High `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 6.5 Medium `AV:N/AC:L/Au:S/C:P/I:P/A:P`

## References

- <http://packetstormsecurity.com/files/162987/Grav-CMS-1.7.10-Server-Side-Template-Injection.html> (exploit, third-party-advisory, vdb-entry, web)
- <https://blog.sonarsource.com/grav-cms-code-execution-vulnerabilities> (exploit, third-party-advisory, web)
- <https://github.com/getgrav/grav/security/advisories/GHSA-g8r4-p96j-xfxc> (third-party-advisory, web)
- <https://packagist.org/packages/getgrav/grav> (product, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-29440> (advisory)

## Sources

- CVE List: [CVE-2021-29440](https://www.cve.org/CVERecord?id=CVE-2021-29440), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-g8r4-p96j-xfxc](https://github.com/advisories/GHSA-g8r4-p96j-xfxc), CC-BY-4.0, modified 2026-05-04
- NVD: [CVE-2021-29440](https://nvd.nist.gov/vuln/detail/CVE-2021-29440), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-29440 · Whole record: https://cve.day/CVE-2021-29440.json · Rebuilt by cve.day 2026-11-25T22:58:00.802Z
