← back
CVE-2023-34448highCWE-1336CWE-20

Grav Server-side Template Injection (SSTI) via Twig Default Filters

21Vexday Risk Score

No sign of exploitation. No public exploitation artifact known so far.

ssvc Trackcvss 8.8epss 4.5%
exploitation probability
4.5%top 9% of all CVEs
observed exploitation
nono source reports it
In short

Grav CMS has a template injection vulnerability where attackers can run arbitrary code through Twig's built-in functions like map() and reduce(), even though a previous patch tried to fix a similar issue. This allows remote code execution if an attacker can control template input.

Technical detail

Server-side template injection (SSTI) in Grav versions before 1.7.42 enables remote code execution through unsafe Twig Core Extension functions (map, reduce filters). The vulnerability exists because the previous CVE-2022-2073 patch only blocked the filter() function but failed to validate arguments in other dangerous built-in functions. An attacker with the ability to inject template code can exploit the unvalidated $arrow parameter to invoke arbitrary functions.

Summary generated and translated by AI from the official description.
Grav is a flat-file content management system. Prior to version 1.7.42, the patch for CVE-2022-2073, a server-side template injection vulnerability in Grav leveraging the default `filter()` function, did not block other built-in functions exposed by Twig's Core Extension that could be used to invoke arbitrary unsafe functions, thereby allowing for remote code execution. A patch in version 1.74.2 overrides the built-in Twig `map()` and `reduce()` filter functions in `system/src/Grav/Common/Twig/Extension/GravExtension.php` to validate the argument passed to the filter in `$arrow`.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected products
getgrav · grav