← back
CVE-2023-34448

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

CVSS 8.8 HIGHEPSS 4.5%CWE-1336CWE-20
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

Want to know if your infrastructure is exposed to this?

Talk to TrueHacking →