Loading advisory.
Loading advisory.
Grav: .htaccess file extension rules bypass via case variation on case-insensitive filesystems
The default .htaccess shipped with Grav (and the reference webserver-configs/htaccess.txt) contains security rules that block direct HTTP access to sensitive file types (.yaml, .yml, .php, .json, .twig, etc.) under user/ and system/vendor/ directories.
Published 2026-08-19 19:32 UTC · Modified 2026-09-10 03:51 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| getgrav/grav | Packagist | < 2.0.4 versions 0.8.0, 0.9.0, 0.9.1, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15, 0.9.16, 0.9.17, 0.9.18, 0.9.19, 0.9.2, 0.9.20, 0.9.21, 0.9.22, 0.9.23, 0.9.24, 0.9.25 and 318 more | 2.0.4 | composer require 'getgrav/grav:>=2.0.4' |
The default .htaccess shipped with Grav (and the reference webserver-configs/htaccess.txt) contains security rules that block direct HTTP access to sensitive file types (.yaml, .yml, .php, .json, .twig, etc.) under user/ and system/vendor/ directories. However, these rules lack the [NC] (No Case) flag, making them case-sensitive. On case-insensitive filesystems (Windows/NTFS, macOS/HFS+, or Linux with Docker volumes mounted from Windows/macOS), an attacker can bypass these rules by requesting files with uppercase extensions (e.g., .YAML, .PHP, .JSON).
Grav 2.0.1 (latest stable as of June 2026) — confirmed
Grav 1.7.x — likely affected (same .htaccess rules)
All versions shipping the current webserver-configs/htaccess.txt
File: .htaccess (root of Grav installation)
Reference: webserver-configs/htaccess.txt
# Line 68 — system/vendor file types
RewriteRule ^(system|vendor)/(.*)\.(txt|xml|md|html|htm|shtml|shtm|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ error [F]
# Line 70 — user file types
RewriteRule ^(user)/(.*)\.(txt|md|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ error [F]
# Line 72 — .md files globally
RewriteRule \.md$ error [F]All three rules use [F] without [NC], making the extension match case-sensitive.
Install Grav on a system with a case-insensitive filesystem:
Windows (native WAMP/XAMPP)
macOS (default HFS+)
Docker on Windows/macOS with volume mounts (e.g., ./data:/var/www/html)
Create or use any plugin that stores sensitive data in its YAML config (e.g., API keys):
user/plugins/my-plugin/my-plugin.yamlRequest the file with a case-varied extension:
GET /user/plugins/my-plugin/my-plugin.YAML HTTP/1.1Expected: HTTP 403 Forbidden
Actual: HTTP 200 OK — full file contents returned, including any API keys or sensitive configuration
Information disclosure: Plugin configuration files (.yaml) containing API keys, credentials, or sensitive settings can be read by unauthenticated users
Source code exposure: PHP source files can be downloaded (instead of executed) when requested with .PHP extension on some configurations
Configuration exposure: user/config/system.yaml, user/config/site.yaml, and other system configuration files are accessible
Add the [NC] flag to the three affected rules:
RewriteRule ^(system|vendor)/(.*)\.(txt|xml|md|html|htm|shtml|shtm|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ error [F,NC]
RewriteRule ^(user)/(.*)\.(txt|md|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ error [F,NC]
RewriteRule \.md$ error [F,NC]The [NC] flag makes the extension matching case-insensitive, covering .YAML, .Yaml, .PHP, .Json, etc.
On native Linux with ext4 filesystem (case-sensitive), the attack does not work because Apache cannot resolve the uppercase filename to the actual file
Grav 2.0's Twig sandbox blocks access to plugins config subtree from page content, preventing SSTI-based config exfiltration
The user/accounts/, user/config/, and user/data/ folders have separate rules (line 62, 66) that block ALL file types regardless of extension — these are not affected
Grav: 2.0.1
PHP: 8.3
Apache: 2.4 with mod_rewrite
OS: Docker (php:8.3-apache) with volume mounted from Windows 10 (NTFS)
Tested: June 2026
Sisnetic
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
No EPSS history yet. Either the CVE has no score or the scores have not been fetched.