{"api_version":"1","generated_at":"2026-04-22T16:04:58+00:00","cve":"CVE-2023-34252","urls":{"html":"https://cve.report/CVE-2023-34252","api":"https://cve.report/api/cve/CVE-2023-34252.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2023-34252","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2023-34252"},"summary":{"title":"CVE-2023-34252","description":"Grav is a file-based Web platform. Prior to version 1.7.42, there is a logic flaw in the `GravExtension.filterFilter()` function whereby validation against a denylist of unsafe functions is only performed when the argument passed to filter is a string. However, passing an array as a callable argument allows the validation check to be skipped. Consequently, a low privileged attacker with login access to Grav Admin panel and page creation/update permissions is able to inject malicious templates to obtain remote code execution. The vulnerability can be found in the `GravExtension.filterFilter()` function declared in `/system/src/Grav/Common/Twig/Extension/GravExtension.php`. Version 1.7.42 contains a patch for this issue. End users should also ensure that `twig.undefined_functions` and `twig.undefined_filters` properties in `/path/to/webroot/system/config/system.yaml` configuration file are set to `false` to disallow Twig from treating undefined filters/functions as PHP functions and executing them.","state":"PUBLIC","assigner":"security-advisories@github.com","published_at":"2023-06-14 22:15:00","updated_at":"2023-11-07 04:15:00"},"problem_types":["CWE-94"],"metrics":[],"references":[{"url":"https://github.com/getgrav/grav/commit/244758d4383034fe4cd292d41e477177870b65ec","name":"https://github.com/getgrav/grav/commit/244758d4383034fe4cd292d41e477177870b65ec","refsource":"MISC","tags":[],"title":"also handle SSTI in reduce twig filter + function · getgrav/grav@244758d · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Utils.php#L1956-L2074","name":"https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Utils.php#L1956-L2074","refsource":"MISC","tags":[],"title":"grav/system/src/Grav/Common/Utils.php at 1.7.40 · getgrav/grav · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-96xv-rmwj-6p9w","name":"https://github.com/getgrav/grav/security/advisories/GHSA-96xv-rmwj-6p9w","refsource":"MISC","tags":[],"title":"Grav Server-side Template Injection (SSTI) via Insufficient Validation in filterFilter · Advisory · getgrav/grav · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Twig/Extension/GravExtension.php#L1692-L1698","name":"https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Twig/Extension/GravExtension.php#L1692-L1698","refsource":"MISC","tags":[],"title":"grav/system/src/Grav/Common/Twig/Extension/GravExtension.php at 1.7.40 · getgrav/grav · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://github.com/getgrav/grav/commit/8c2c1cb72611a399f13423fc6d0e1d998c03e5c8","name":"MISC:https://github.com/getgrav/grav/commit/8c2c1cb72611a399f13423fc6d0e1d998c03e5c8","refsource":"MITRE","tags":[],"title":"better SSTI in |map and |filter · getgrav/grav@8c2c1cb · GitHub","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://www.cve.org/CVERecord?id=CVE-2023-34252","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-34252","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[{"cve_year":"2023","cve_id":"34252","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"a","cpe4":"getgrav","cpe5":"grav","cpe6":"*","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"*","cpe11":"*","cpe12":"*","cpe13":"*"}],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"data_version":"4.0","data_type":"CVE","data_format":"MITRE","CVE_data_meta":{"ID":"CVE-2023-34252","ASSIGNER":"security-advisories@github.com","STATE":"PUBLIC"},"description":{"description_data":[{"lang":"eng","value":"Grav is a file-based Web platform. Prior to version 1.7.42, there is a logic flaw in the `GravExtension.filterFilter()` function whereby validation against a denylist of unsafe functions is only performed when the argument passed to filter is a string. However, passing an array as a callable argument allows the validation check to be skipped. Consequently, a low privileged attacker with login access to Grav Admin panel and page creation/update permissions is able to inject malicious templates to obtain remote code execution. The vulnerability can be found in the `GravExtension.filterFilter()` function declared in `/system/src/Grav/Common/Twig/Extension/GravExtension.php`. Version 1.7.42 contains a patch for this issue. End users should also ensure that `twig.undefined_functions` and `twig.undefined_filters` properties in `/path/to/webroot/system/config/system.yaml` configuration file are set to `false` to disallow Twig from treating undefined filters/functions as PHP functions and executing them."}]},"problemtype":{"problemtype_data":[{"description":[{"lang":"eng","value":"CWE-184: Incomplete List of Disallowed Inputs","cweId":"CWE-184"}]},{"description":[{"lang":"eng","value":"CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine","cweId":"CWE-1336"}]}]},"affects":{"vendor":{"vendor_data":[{"vendor_name":"getgrav","product":{"product_data":[{"product_name":"grav","version":{"version_data":[{"version_affected":"=","version_value":"< 1.7.42"}]}}]}}]}},"references":{"reference_data":[{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-96xv-rmwj-6p9w","refsource":"MISC","name":"https://github.com/getgrav/grav/security/advisories/GHSA-96xv-rmwj-6p9w"},{"url":"https://github.com/getgrav/grav/commit/244758d4383034fe4cd292d41e477177870b65ec","refsource":"MISC","name":"https://github.com/getgrav/grav/commit/244758d4383034fe4cd292d41e477177870b65ec"},{"url":"https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Twig/Extension/GravExtension.php#L1692-L1698","refsource":"MISC","name":"https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Twig/Extension/GravExtension.php#L1692-L1698"},{"url":"https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Utils.php#L1956-L2074","refsource":"MISC","name":"https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Utils.php#L1956-L2074"}]},"source":{"advisory":"GHSA-96xv-rmwj-6p9w","discovery":"UNKNOWN"},"impact":{"cvss":[{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"HIGH","baseScore":8.8,"baseSeverity":"HIGH","confidentialityImpact":"HIGH","integrityImpact":"HIGH","privilegesRequired":"LOW","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"}]}},"nvd":{"publishedDate":"2023-06-14 22:15:00","lastModifiedDate":"2023-11-07 04:15:00","problem_types":["CWE-94"],"metrics":{"baseMetricV3":{"cvssV3":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"HIGH","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH","baseScore":7.2,"baseSeverity":"HIGH"},"exploitabilityScore":1.2,"impactScore":5.9}},"configurations":{"CVE_data_version":"4.0","nodes":[{"operator":"OR","children":[],"cpe_match":[{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*","versionEndExcluding":"1.7.42","cpe_name":[]}]}]}},"legacy_mitre":{"record":null,"notes":[]}}}