# CVE-2023-34252: Grav Server-side Template Injection via Insufficient Validation in filterFilter

- Severity: High 8.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/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): 2.03%, higher than 82% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2023-06-14T21:38:48.358Z
- Modified: 2026-06-17T06:03:13.580Z
- Also known as: GHSA-96xv-rmwj-6p9w
- Weaknesses: CWE-94, CWE-184, CWE-1336
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: GitHub_M

## Description

Grav is a flat-file content management system. Prior to version 1.7.42, there is a logic flaw in the `GravExtension.filterFilter()` function whereby validation against a denylist of unsafe functions is only performed when the argument passed to filter is a string. However, passing an array as a callable argument allows the validation check to be skipped. Consequently, a low privileged attacker with login access to Grav Admin panel and page creation/update permissions is able to inject malicious templates to obtain remote code execution. The vulnerability can be found in the `GravExtension.filterFilter()` function declared in `/system/src/Grav/Common/Twig/Extension/GravExtension.php`. Version 1.7.42 contains a patch for this issue. End users should also ensure that `twig.undefined_functions` and `twig.undefined_filters` properties in `/path/to/webroot/system/config/system.yaml` configuration file are set to `false` to disallow Twig from treating undefined filters/functions as PHP functions and executing them.

(As written by CVE List.)

## Affected

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

## Every score

- GitHub_M: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- GitHub: 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:3.1 7.2 High `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/getgrav/grav/security/advisories/GHSA-96xv-rmwj-6p9w> (exploit, vendor-advisory, web)
- <https://github.com/getgrav/grav/commit/244758d4383034fe4cd292d41e477177870b65ec> (patch, web)
- <https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Twig/Extension/GravExtension.php#L1692-L1698> (issue-tracking, web)
- <https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Utils.php#L1956-L2074> (issue-tracking, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-34252> (advisory)
- <https://github.com/getgrav/grav/commit/71bbed12f950de8335006d7f91112263d8504f1b> (web)
- <https://github.com/getgrav/grav/commit/8c2c1cb72611a399f13423fc6d0e1d998c03e5c8> (web)
- <https://github.com/getgrav/grav/commit/9d01140a63c77075ef09b26ef57cf186138151a5> (web)
- <https://github.com/getgrav/grav> (package)

## Sources

- CVE List: [CVE-2023-34252](https://www.cve.org/CVERecord?id=CVE-2023-34252), CVE Terms of Use, modified 2024-12-18
- GitHub Advisory Database: [GHSA-96xv-rmwj-6p9w](https://github.com/advisories/GHSA-96xv-rmwj-6p9w), CC-BY-4.0, modified 2024-02-16
- NVD: [CVE-2023-34252](https://nvd.nist.gov/vuln/detail/CVE-2023-34252), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-34252 · Whole record: https://cve.day/CVE-2023-34252.json · Rebuilt by cve.day 2026-11-25T22:58:24.862Z
