Sep 18, 2026·4 min read·46 visits
Incomplete denylist validation of bare PHP functions in Grav Blueprints allows authenticated users to trigger arbitrary file writes and achieve remote code execution.
An arbitrary file write and remote code execution vulnerability exists in Grav CMS before version 2.0.15. The vulnerability is caused by using an incomplete denylist validation approach for bare PHP functions in the Blueprint dynamic-data compiler, allowing authenticated users with page-editing or blueprint-configuration privileges to execute arbitrary functions such as error_log.
Grav CMS relies on YAML configurations called Blueprints to dynamically define administration forms, page configurations, and data structures. To populate these structures with dynamic options, Blueprints use dynamic data directives indicated by an '@' suffix, such as 'data-options@'. These directives instruct the compiler to execute a designated callable using PHP's call_user_func_array function.\n\nBecause Blueprints can be altered by users with administrative or page-editing privileges, executing arbitrary PHP callables poses a direct security risk. Grav implements the Blueprint::isSafeDynamicCall method to validate and authorize dynamic callables before execution. In versions prior to 2.0.15, this safety mechanism was insufficient, allowing arbitrary function execution through unprotected call paths.
The primary defect resides in system/src/Grav/Common/Data/Blueprint.php within the isSafeDynamicCall method. While class method callables (e.g., Class::method) were constrained by a strict positive allowlist, bare string functions (e.g., 'system' or 'error_log') were checked against an incomplete denylist in Utils::isDangerousFunction.\n\nDenylists are architecturally prone to omission errors. In this implementation, dangerous built-in PHP functions like 'error_log' and 'stream_socket_client' were not registered within the denylist. Consequently, when an input specified 'error_log' as the dynamic function, the function returned true, designating the call as safe. This allowed unauthorized users to execute unrestricted administrative functions via the template processor.
Prior to version 2.0.15, the bare-function validation in system/src/Grav/Common/Data/Blueprint.php relied on checking whether a string function was registered in a list of dangerous functions:\n\nphp\n// Vulnerable Implementation\nif (is_string($function) && Utils::isDangerousFunction($function)) {\n return false;\n}\nreturn true;\n\n\nTo resolve this vulnerability in version 2.0.15, the developers removed the denylist model entirely and implemented a symmetrical allowlist-based verification. Bare functions must now be explicitly declared in the static allowlist array or registered by trusted plugins:\n\nphp\n// Patched Implementation (Commit d5f89d95d94cc155bc3be998ee85527a7be073dd)\nif (!is_string($function) || !isset(self::$allowedDynamicCallables[strtolower(ltrim($function, '\\'))])) {\n return false;\n}\n\n\nAdditionally, the patch introduced provenance-based trust. Blueprints compiled directly from local filesystem template files are marked as trusted and bypass certain allowlist restrictions. Blueprints derived from user-controlled page frontmatter are classified as untrusted, enforcing strict allowlist checks to block arbitrary call execution.
An attacker with page-editing or blueprint-configuration permissions can exploit this behavior by writing a crafted YAML payload into a page configuration or frontmatter section. The payload defines a dynamic directive pointing to 'error_log' and supplies arguments to trigger a file write. Because 'error_log' accepts a message, a message type, and a destination file path, it acts as an arbitrary file write primitive.\n\nyaml\nform:\n fields:\n exploit_field:\n type: text\n data-options@: ['error_log', ['<?php system($_GET["cmd"]); ?>', 3, 'user/pages/shell.php']]\n\n\nUpon receiving a request that triggers blueprint compilation, Grav parses the field and invokes error_log. The function creates the target PHP file 'user/pages/shell.php' inside a web-accessible directory. The attacker can then request this file directly to execute arbitrary operating system commands in the security context of the web server daemon.\n\nmermaid\ngraph LR\n A["Attacker Modifies Blueprint"] --> B["Grav Parses Blueprint Directive"]\n B --> C["isSafeDynamicCall Checks Bare Function"]\n C -->|"Bypasses Denylist"| D["call_user_func_array Executes error_log"]\n D --> E["PHP Payload Written to Disk"]\n
The vulnerability carries a CVSS base score of 8.8 (High) under CVSS v3.1, and 9.3 (Critical) under CVSS v4.0. Successful exploitation allows an authenticated user with low-level administrative or page-editing privileges to completely bypass intended access restrictions and execute arbitrary code on the hosting server.\n\nThis impact compromises host confidentiality, integrity, and availability. An attacker can read database credentials, exfiltrate sensitive application data, alter page content, or pivot laterally to other internal systems. This risk is particularly high in multi-tenant environments where page editors should not have server-level administrative access.
Remediation requires upgrading Grav Core to version 2.0.15 or higher. This release integrates the provenance-based trust engine and enforces the strict allowlist check for all dynamic callables.\n\nIf an immediate upgrade is not feasible, administrators should audit the filesystem for unauthorized dynamic directives. Inspect existing page frontmatter files for '@' characters combined with PHP system calls or raw string functions. Additionally, deploy web application firewall rules to block requests containing '@' suffixes in fields coupled with raw PHP function names.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
Grav CMS Core getgrav | < 2.0.15 | 2.0.15 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-94 |
| Attack Vector | Network |
| CVSS v3.1 | 8.8 (High) |
| EPSS Score | 0.00777 |
| Exploit Status | PoC Verified |
| KEV Status | Not Listed |
The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes the input before it is executed.
GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.
CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.
CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.
An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.
A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.
A symbolic link traversal vulnerability (CWE-59) in Canonical LXD and Linux Containers Incus allows an authenticated user with image import permissions to read and write arbitrary files on the host filesystem. During image archive unpacking, the daemon fails to reject top-level symbolic links for the instance `templates` directory. Subsequent requests to the instance template API endpoints follow this symbolic link outside the instance storage directory with root privileges, enabling complete host compromise.