Miggo Logo

CVE-2024-28119: Server Side Template Injection (SSTI) via Twig escape handler

8.8

CVSS Score
3.1

Basic Information

EPSS Score
0.8225%
Published
3/22/2024
Updated
1/3/2025
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
getgrav/gravcomposer< 1.7.451.7.45

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry *u* to t** unr*stri*t** ****ss to twi* *xt*nsion *l*ss *rom *r*v *ont*xt, *n *tt**k*r **n r****in* t** *s**p* *un*tion *n* *x**ut* *r*itr*ry *omm*n*s. ### **t*ils *ttps://*it*u*.*om/twi*p*p/Twi*/*lo*/*.x/sr*/*xt*nsion/*s**p*r*xt*nsion.p*

Reasoning

T** vuln*r**ility st*ms *rom t** unr*stri*t** ****ss to Twi*'s *s**p*r*xt*nsion::s*t*s**p*r m*t*o* in *r*v's Twi* *nvironm*nt. T*is m*t*o* ****pts * **ll**l* *r*um*nt wit*out v*li**tion, *n**lin* *tt**k*rs to r**ist*r P*P *un*tions lik* syst*m *s *s*