A resource exhaustion vulnerability exists in Grav versions from 2.0.0 up to but not including 2.2.18. Unauthenticated attackers can exploit this by sending HTTP requests with varying Host headers, causing the system to create multiple per-host caches. This can fill the disk and lead to failures in session management, file uploads, and logging.
Grav CMS versions prior to 2.0.16 contain a timing side-channel vulnerability in the Utils::verifyNonce() function used for CSRF protection. The function compares nonces using PHP's === operator, which is not constant time and leaks timing information about how many leading bytes match. This can potentially allow an attacker to guess valid nonces by measuring response times. The vulnerability is fixed in version 2.0.16.
Grav CMS versions 2.0.7 through 2.0.10 contain a vulnerability in blueprint dynamic fields where the callable validation is incomplete. This allows a user with page-editing rights (not super-admin) to invoke arbitrary public static PHP methods via crafted form-field frontmatter, leading to arbitrary file reading and file/directory creation or copying under the web-server account. The flaw bypasses the callable guard by allowing fully-qualified Class::method strings to skip dangerous function checks. A fix is available in version 2.0.11.
Grav versions 2.0.0-rc.9 and the current 2.0 branch contain a stored CSS injection vulnerability via the Markdown image resize() media action. This allows a lower-privileged content editor to inject arbitrary CSS declarations into the style attribute of rendered images, which are then executed in the context of higher-privileged users viewing the content. The vulnerability arises because the resize() method does not properly sanitize or validate input values before embedding them as CSS style attributes. This can lead to UI redress attacks such as overlays that manipulate the admin interface. A patch is available to properly sanitize these inputs.
Grav versions before 2.0.16 have an incomplete default denylist in the Twig sandbox configuration, which allows attackers with page-edit permissions to access sensitive system configuration secrets such as system.cache.redis.password when config_access is enabled. This vulnerability can lead to exposure of critical secrets through Twig templates.
Grav CMS versions before 2.0.16 contain a vulnerability in sandboxed Twig templates where allow-listed offsetGet() and offsetexists() methods on User objects do not filter sensitive fields. This allows attackers with page-edit permissions to access hashed passwords and two-factor authentication secrets. The vulnerability enables offline password cracking and potential authentication bypass.
Grav CMS versions before 2.0.16 have an origin validation bypass vulnerability in the Uri::referrer() and Pages::referrerRoute() methods. The issue arises because these methods validate the Referer header using an unanchored prefix match without a trailing delimiter. This allows an attacker controlling a domain that starts with the victim's origin to bypass the Referer-based origin check.
Grav CMS versions before 2.0.16 have a timing vulnerability in the Utils::verifyNonce() function used for CSRF protection. The vulnerability arises because the nonce comparison uses a non-constant-time string comparison operator (===) instead of a constant-time function like hash_equals(). This allows attackers to measure timing differences in responses to recover valid nonce values byte-by-byte, weakening the effectiveness of CSRF protection.
Grav CMS versions before 2.0.16 have a vulnerability where system, site, and theme configuration arrays are not filtered in sandboxed Twig template renders. This allows attackers with page-content edit permissions to read sensitive configuration data, including secrets like cache credentials, by bypassing config_denied_paths restrictions using dot notation in Twig templates.
Grav CMS versions prior to 2.0.16 have a path traversal vulnerability in the media_directory() Twig function. This flaw allows authenticated users with page authoring privileges to supply arbitrary filesystem paths, enabling them to enumerate and read files outside the intended directory scope. The vulnerability arises because the function does not properly validate filesystem paths, permitting access to any file matching configured media extensions accessible by the web server process.
Grav before version 2.0.16 has a path traversal vulnerability in the MediaUploadTrait::deleteFile() function. Authenticated users with media management permissions can exploit this flaw to delete arbitrary files by using directory traversal sequences in filenames. The vulnerability arises because the method only validates the basename of the filename but does not properly sanitize directory paths containing '../' sequences, which are passed to the unlink() function. This allows deletion of files outside the intended media storage directory.
Grav before version 2.0.15 has a stored cross-site scripting (XSS) vulnerability in the detectXss() function. The flaw allows authenticated editors to inject event-handler attributes such as onerror= by exploiting unpaired quotes in unquoted attribute values, bypassing event-handler detection. This can lead to execution of malicious scripts in visitors' browsers when the affected page content is rendered.
Grav before version 2.0.15 has an arbitrary file write vulnerability in its Blueprint dynamic-data bare-function validation. The vulnerability arises because the validation uses an incomplete denylist rather than a positive allowlist. Attackers with page-edit or blueprint-config permissions can exploit this flaw to invoke the error_log function via a data directive, allowing them to append PHP payloads to web-accessible files and potentially achieve remote code execution.
Grav versions before 2.0.14 have a stored cross-site scripting (XSS) vulnerability in the Security::detectXss() function. A single invalid UTF-8 byte in page content causes all XSS detection patterns to fail, bypassing the XSS safety check. An authenticated user with page-edit permissions but without the XSS whitelist privilege can exploit this to store malicious JavaScript that executes in visitors' browsers.
Grav CMS versions before 2.0.14 contain a critical vulnerability where the core group blueprint's access field lacks proper admin.super guard. This allows a delegated admin.users operator to escalate privileges to super-admin by setting access[admin][super]=true, thereby gaining high-level capabilities such as scheduler and Twig evaluation.
Grav CMS versions prior to 2.0.15 have a path traversal vulnerability in the static asset server component (index.php). The vulnerability arises from improper directory-boundary validation, allowing unauthenticated attackers to access files outside the intended asset directory by exploiting directory names that extend the base path string. This advisory is a duplicate and has been withdrawn in favor of GHSA-4v9q-p283-qc2m.
Grav CMS versions prior to 2.0.13 contain a remote code execution vulnerability in the Flex Objects plugin. Authenticated users can exploit this flaw by uploading a specially crafted ZIP file containing PHP code, bypassing name validation via array notation, and causing execution of arbitrary code on the server.
Grav version 2.0.0 contains a cross-site scripting (XSS) vulnerability related to its blueprint validation process. The vulnerability arises when Twig content processing is enabled, allowing an attacker with page-write API permissions to bypass the XSS validator by using Twig string concatenation to construct malicious event handlers or tags dynamically. This results in arbitrary JavaScript execution in visitors' browsers. The issue was fixed in version 2.0.1.
Grav CMS versions up to 2.0.0-rc.9 contain a stored CSS injection vulnerability via the Markdown image resize() media action. This flaw allows a lower-privileged content editor to inject crafted CSS into image style attributes, which are then rendered when viewed by higher-privileged users. The vulnerability enables UI redress and content manipulation attacks without requiring JavaScript execution. The issue is fixed in Grav 2.0.0.
Grav versions before 2.0.0-beta.2 are affected by an XML External Entity (XXE) injection vulnerability in the SVG file upload functionality. This flaw allows authenticated attackers to read arbitrary files on the server by exploiting improper handling of XML entities in SVG files. The vulnerability arises because the application uses simplexml_load_string without disabling external entity loading. A patch is available to address this issue.