{"id":"CVE-2023-37897","published":"2023-07-18T20:22:13Z","modified":"2024-10-18T17:19:07Z","title":"Server-side Template Injection (SSTI) in grav","vendor":"getgrav","product":"grav","tier":"tail","description":{"text":"Grav is a file-based Web-platform built in PHP. Grav is subject to a server side template injection (SSTI) vulnerability. The fix for another SSTI vulnerability using `|map`, `|filter` and `|reduce` twigs implemented in the commit `71bbed1` introduces bypass of the denylist due to incorrect return value from `isDangerousFunction()`, which allows to execute the payload prepending double backslash (`\\\\`). The `isDangerousFunction()` check in version 1.7.42 and onwards retuns `false` value instead of `true` when the `\\` symbol is found in the `$name`. This vulnerability can be exploited if the attacker has access to: 1. an Administrator account, or 2. a non-administrator, user account that has Admin panel access and Create/Update page permissions. A fix for this vulnerability has been introduced in commit `b4c6210` and is included in release version `1.7.42.2`. Users are advised to upgrade. There are no known workarounds for this vulnerability.\n\n","provenance":"source","from":"CVE.org"},"cvss":{"score":7.2,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.02809,"percentile":0.86494,"provenance":"source"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"},{"id":"CWE-393","name":"Return of Wrong Status Code"}],"references":[{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-9436-3gmp-4f53","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/getgrav/grav/commit/71bbed12f950de8335006d7f91112263d8504f1b","tags":["x_refsource_MISC"]},{"url":"https://github.com/getgrav/grav/commit/b4c62101a43051fc7f5349c7d0a5b6085375c1d7","tags":["x_refsource_MISC"]}],"priority":{"score":22.3,"factors":[{"name":"EPSS percentile","points":17.3},{"name":"CVSS severity","points":5.04}]},"vendorSlug":"getgrav","affectedVersions":[{"vendor":"getgrav","product":"grav","versions":["< 1.7.42.2"]}],"affected":[{"ecosystem":"Packagist","package":"getgrav/grav","vulnerableRanges":["<1.7.42.2"],"patched":["1.7.42.2"],"from":["GHSA-9436-3gmp-4f53"],"provenance":"source"}],"euvd":{"id":"EUVD-2023-2010","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-getgrav-grav-cve-2022-2073","parents":[{"from":"CVE-2023-34448","to":"CVE-2023-37897","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["system/src/Grav/Common/Utils.php"],"commits":["https://github.com/getgrav/grav/commit/8c2c1cb72611a399f13423fc6d0e1d998c03e5c8","https://github.com/getgrav/grav/commit/244758d4383034fe4cd292d41e477177870b65ec","https://github.com/getgrav/grav/commit/71bbed12f950de8335006d7f91112263d8504f1b","https://github.com/getgrav/grav/commit/b4c62101a43051fc7f5349c7d0a5b6085375c1d7"],"basis":"shared function","functions":["getSupportPageTypes","isDangerousFunction"]}]}],"packageHistory":[{"cve":"CVE-2023-34252","published":"2023-06-14","fixed":"1.7.42","kev":false},{"cve":"CVE-2023-34253","published":"2023-06-14","fixed":"1.7.42","kev":false},{"cve":"CVE-2023-34448","published":"2023-06-14","fixed":"1.7.42","kev":false},{"cve":"CVE-2023-37897","published":"2023-07-18","fixed":"1.7.42.2","kev":false},{"cve":"CVE-2024-27923","published":"2024-03-06","fixed":"1.7.43","kev":false,"link":{"from":"CVE-2023-37897","to":"CVE-2024-27923","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:getgrav/grav","fromFixed":"1.7.42.2","toFixed":"1.7.43","daysApart":232}]}},{"cve":"CVE-2023-31506","published":"2024-02-09","fixed":"1.7.44","kev":false},{"cve":"CVE-2024-27921","published":"2024-03-21","fixed":"1.7.45","kev":false}],"package":"Packagist:getgrav/grav"}}