CVE-2023-34252 json
Grav Server-side Template Injection via Insufficient Validation in filterFilter
published 2023-06-14 3 y ago modified 2026-06-17 4 mo ago also GHSA-96xv-rmwj-6p9w , EUVD-2023-1758
- cvss
- 8.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.1%
- EPSS 2.1% chance of exploitation in 30 days, percentile 81%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- packagist getgrav/grav 1.7.42
- getgrav grav 1.7.42
- github.com/getgrav/grav@244758d commit
- github.com/getgrav/grav@71bbed1 commit
- github.com/getgrav/grav@8c2c1cb commit
- github.com/getgrav/grav@9d01140 commit
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- total
- Assessed
- 22 mo ago
Exploit prediction
2.07% chance of exploitation in the next 30 days, higher than 81% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/getgrav/grav/security/advisories/GHSA-96xv-rmwj-6p9w referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.2 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 7.2 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| packagist | getgrav/grav | <1.7.42 |
1.7.42 |
Affected products
- getgrav grav
Classification
References
-
github.com
/getgrav/grav/commit/244758d4383034fe4cd292d41e477177870b65ec
web, patch
-
github.com
/getgrav/grav/commit/71bbed12f950de8335006d7f91112263d8504f1b
web
-
github.com
/getgrav/grav/commit/8c2c1cb72611a399f13423fc6d0e1d998c03e5c8
web
-
github.com
/getgrav/grav/commit/9d01140a63c77075ef09b26ef57cf186138151a5
web
-
github.com
/getgrav/grav/security/advisories/GHSA-96xv-rmwj-6p9w
web, exploit, vendor-advisory
-
github.com
/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Twig/Extension/GravExtension.php#L1692-L1698
web, issue-tracking
-
github.com
/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Utils.php#L1956-L2074
web, issue-tracking
-
nvd.nist.gov
/vuln/detail/CVE-2023-34252
advisory
-
github.com
/getgrav/grav
package
Sources
- CVE List CVE-2023-34252
- GitHub Advisory GHSA-96xv-rmwj-6p9w
- NVD CVE-2023-34252
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.