CVE-2024-28119: Server Side Template Injection (SSTI) via Twig escape handler
8.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.8225%
CWE
Published
3/22/2024
Updated
1/3/2025
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| getgrav/grav | composer | < 1.7.45 | 1.7.45 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the unrestricted access to Twig's EscaperExtension::setEscaper method in Grav's Twig environment. This method accepts a callable argument without validation, enabling attackers to register PHP functions like system as escapers. The PoC demonstrates this by setting twig_array_filter (a valid callable) as the 'system' escaper and triggering it via the escape filter. Grav's patch explicitly blocks access to core.setEscaper in Security::cleanDangerousTwig, confirming its role in the exploit chain. The function's design (lack of input validation) combined with Grav's insecure exposure of the method to template processing creates the vulnerability.