Cyber Resilience

CVE-2023-34448

RCE in Getgrav Grav ≤ 1.7.42

Public PoCRCE
Published
14 June 2023
Modified
21 November 2024
Patch / advisory
CVSS Score v3.1 8.8
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.045 91th percentile
Risk Priority 72 floored blend · peak EPSS

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, exploitation aligns with the MITRE ATT&CK technique Template Injection (T1221); ranked in the top 9% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

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.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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

MITRE ATT&CK Enterprise Techniques

T1221 Template Injection Stealth
Adversaries may create or modify references in user document templates to conceal malicious code or force authentication attempts.
T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1059.001 PowerShell Execution
Adversaries may abuse PowerShell commands and scripts for execution.
T1059.002 AppleScript Execution
Adversaries may abuse AppleScript for execution.
T1059.004 Unix Shell Execution
Adversaries may abuse Unix shell commands and scripts for execution.
T1059.005 Visual Basic Execution
Adversaries may abuse Visual Basic (VB) for execution.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2025-66299Same product: Getgrav Grav
CVE-2025-66294Same product: Getgrav Grav
CVE-2024-28116Same product: Getgrav Grav
CVE-2023-34252Same product: Getgrav Grav
CVE-2023-34253Same product: Getgrav Grav
CVE-2024-28118Same product: Getgrav Grav
CVE-2023-34251Same product: Getgrav Grav
CVE-2024-28119Same product: Getgrav Grav
CVE-2024-28117Same product: Getgrav Grav
CVE-2025-66298Same product: Getgrav Grav

Affected Assets

getgrav
grav
≤ 1.7.42

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)
  • 6 hardening rules · 3 OS baselines
Validate
Prove the fix (OWASP ASVS)
  • V1.3.2
  • V1.3.7
  • V1.3.10
  • V1.3.1

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.

addresses: CWE-20 CWE-94

Directly implements checks on information inputs to reject invalid data before processing.

addresses: CWE-20

Security testing and developer training directly verify and enforce proper input validation, reducing exploitability of injection and malformed-data weaknesses.

addresses: CWE-20

Security testing and evaluation at multiple SDLC stages directly detects missing or flawed input validation, with the required remediation process ensuring fixes are applied.

addresses: CWE-94

Makes persistent code injection into loaded programs impossible when the executable image itself resides on hardware-protected read-only media.

addresses: CWE-94

Dynamically generated code can be produced and executed inside the isolated chamber, preventing host compromise from code-injection payloads.

addresses: CWE-94

Directly prevents execution of attacker-supplied code written into data memory regions.

addresses: CWE-20

Spam protection mechanisms perform filtering and detection on inbound/outbound messages, directly compensating for missing or weak input validation of unsolicited content.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly require and enforce input validation during development.

PR.DS-10 none match
prevents

PR.DS-10 protects runtime data confidentiality/integrity but has no bearing on neutralizing externally influenced input during code generation, so neither direction shows any preventive effect.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Testing against a defined set of requirements and using code review plus vulnerability scanning forces validation of inputs and handling of unanticipated conditions, reducing the chance that malformed data will be accepted.

prevents

Secure-coding guidelines and mandatory security testing (including code scans) compel developers to validate and sanitize inputs at design and implementation time, lowering the incidence of malformed or malicious data reaching downstream components.

prevents

Mandating input controls that include integrity checks and input validation ensures that untrusted data is examined before use, blocking the root cause of many injection and malformed-data weaknesses.

prevents

Security-by-design principles explicitly call for data validation and sanitization at every layer, reducing the chance that malformed or malicious input will be processed without scrutiny.

prevents

Requiring language-specific secure coding standards, peer review, SAST and documented mitigation of common programming errors forces validation of all inputs before they are trusted.

none

Regular automated validation of system software and data content, combined with scanning of all inbound files, enforces input validation at the boundary before untrusted content is processed.

Hardening callouts derived

Configuration rules from DISA STIG baselines that bear on weaknesses of the type cited by this CVE. Each rule is shown with the relationship its mapping actually records, against the CWE it was authored against. Derived via CVE→CWE over `controls_xwalks` (authoritative rows only; rows rated `none` are excluded).

RHEL 8 (1 rule)
  • V-230265 RHEL 8 must prevent the installation of software, patches, service packs, device drivers, or operating system components of local packages without verification they have been digitally signed using a certificate that is issued by a Certificate Authority (CA) that is recognized and approved by the organization. prevents CWE-20

References