CVE-2023-34448
Published: 14 June 2023
Summary
CVE-2023-34448 is a high-severity Improper Input Validation (CWE-20) vulnerability in Getgrav Grav. Its CVSS base score is 8.8 (High).
Operationally, ranked in the top 7.3% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.
Deeper analysis
Grav is a flat-file content management system that embeds the Twig templating engine. CVE-2023-34448 is an incomplete remediation of an earlier server-side template injection issue (CVE-2022-2073) that allowed use of the default filter() function. The flaw persisted in versions prior to 1.7.42 because other built-in Twig Core Extension functions, notably map() and reduce(), could still be abused to invoke arbitrary unsafe PHP functions, resulting in remote code execution. The affected code resides in Grav’s Twig integration layer.
An authenticated user with permission to supply or modify page content or templates can supply a crafted Twig expression that reaches these filters. Because the application processes the expression server-side with no additional sandboxing, the attacker can execute operating-system commands, read or modify files, and fully compromise the host. The CVSS 8.8 vector reflects network attack reachability, low complexity, and low privileges required.
The project’s security advisory and accompanying commits state that version 1.7.42 overrides map() and reduce() inside system/src/Grav/Common/Twig/Extension/GravExtension.php, inserting explicit validation of the callable argument passed via the $arrow variable. Administrators are advised to upgrade immediately; no other configuration changes are documented.
EPSS for the CVE has remained flat at 0.0885 with no material increase after disclosure.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2023-1902
Vulnerability details
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…
more
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`.
- CWE(s)
Related Threats
No named actor attribution yet. ATT&CK technique mapping in progress for this CVE.
Affected Assets
Mitigating Controls
Likely Mitigating Controls AI
Per-CVE control mapping for this CVE has not run yet; the list below is derived from the weakness types (CWEs) cited in the NVD entry.
Directly implements checks on information inputs to reject invalid data before processing.
Security testing and developer training directly verify and enforce proper input validation, reducing exploitability of injection and malformed-data weaknesses.
Security testing and evaluation at multiple SDLC stages directly detects missing or flawed input validation, with the required remediation process ensuring fixes are applied.
Makes persistent code injection into loaded programs impossible when the executable image itself resides on hardware-protected read-only media.
Dynamically generated code can be produced and executed inside the isolated chamber, preventing host compromise from code-injection payloads.
Directly prevents execution of attacker-supplied code written into data memory regions.
Spam protection mechanisms perform filtering and detection on inbound/outbound messages, directly compensating for missing or weak input validation of unsolicited content.