CVE-2023-34448: Grav Server-side Template Injection (SSTI) via Twig Default Filters

Published Jun 14, 2023
·
Updated

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.

Other sources

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

— Packagist

Affected Software

3 affected componentsFixes available
composer/getgrav/grav<1.7.42
1.7.42
getgrav grav<1.7.42
composer/getgrav/grav<1.7.42
1.7.42

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/getgrav/grav to a version that resolves this vulnerability.

    Fixed in 1.7.42
  2. Upgrade

    Upgrade getgrav/grav to a version that resolves this vulnerability.

    Fixed in 1.74.2
  3. Configuration

    In the Admin page editor, click Preview, then Advanced, and ensure the checkbox beside Twig is selected so Twig processing is enabled for the modified webpage.

    Grav Admin - Twig processing for modified webpage Twig processing enabled (Advanced tab -> Twig checkbox) = ensure enabled
  4. Operational

    After applying the fix, log out of Grav Admin and log back in using the account created in step 2 (to ensure the changes apply under a session with the intended permissions).

Event History

Jun 14, 2023
CVE Published
via MITRE·10:06 PM
Data Sourced
via MITRE·10:06 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jun 16, 2023
Advisory Published
07:37 PM
Data Sourced
via GitHub·07:37 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via Packagist·07:37 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is CVE-2023-34448?

CVE-2023-34448 is a server-side template injection vulnerability in Grav prior to version 1.7.42 that can be exploited using the default `filter()` function.

2

How severe is CVE-2023-34448?

CVE-2023-34448 has a severity rating of 7.2, which is considered high.

3

What software is affected by CVE-2023-34448?

Grav prior to version 1.7.42 is affected by CVE-2023-34448.

4

How can CVE-2023-34448 be exploited?

CVE-2023-34448 can be exploited by leveraging the default `filter()` function in Grav to perform server-side template injection.

5

Is there a patch available for CVE-2023-34448?

Yes, a patch for CVE-2023-34448 is available in version 1.7.42 of Grav.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203