Summary
CVE-2026-74907 is a path traversal vulnerability (CWE-22) in the static asset server component of Grav CMS, present in index.php. The flaw arises from the use of string-prefix matching instead of proper directory-boundary validation when restricting access to configured asset directories, allowing an unauthenticated remote attacker to read files located in sibling directories outside the intended asset path. It affects all Grav versions prior to 2.0.15 and carries a CVSS v4.0 base score of 8.2 (High).
Technical details
- Root cause: The static asset server validates requested file paths using PHP’s
str_starts_with($realFile, $realBase)to confirm a resolved path stays within the permitted base directory. This check only compares string prefixes rather than verifying a true directory boundary (e.g. appending a path separator), so a sibling directory whose name merely begins with the same characters as the allowed directory (for example,assets-secretwhenassetsis the configured directory) also passes the check. - Trigger conditions: Exploitation applies to deployments where Grav’s fast static asset serving mechanism is active (commonly used with the optional asset-map configuration). No authentication or user interaction is required.
- Attack vector: Network-based; an attacker sends crafted HTTP requests to the Grav-hosted site referencing directory names that extend the configured asset path prefix, causing the server to resolve and return files from unintended, adjacent directories.
- Impact: High confidentiality impact only — successful exploitation can disclose sensitive files stored in directories neighboring the allowed asset path (e.g., configuration data, credentials, or other sensitive content residing outside the intended scope), without impact to integrity or availability.
Affected software
- getgrav/grav (Grav CMS) — all versions before 2.0.15
- Fixed in version 2.0.15
Severity
- CVSS v4.0: 8.2 (High) —
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N - CVSS v3.1: 5.9 (Medium) —
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Mitigation and recommended actions
- Immediate: Upgrade Grav to version 2.0.15 or later, which fixes the boundary check by requiring the resolved path to start with the base directory followed by a path separator, preventing prefix-only matches from passing validation.
- If immediate patching is not possible:
- Restrict or disable the static asset server / asset-map configuration where feasible until the upgrade can be applied.
- Ensure sensitive files and directories (configuration, credentials, logs, vendor/system folders) are not stored in directories adjacent to the configured public asset directory.
- Review and harden any front-end web server (e.g., nginx, Caddy) rules that are intended to block access to sensitive paths, and confirm they are actually being enforced and evaluated before any catch-all rewrite rules.
- Monitor web server access logs for unusual requests referencing directory names that closely resemble but extend legitimate asset directory names.

