{"id":"CVE-2026-62673","aliases":["CVE-2026-62230","GHSA-vwg3-w8w3-pc79"],"url":"https://o3.security/vulnerability/CVE-2026-62673","summary":"Grav: .htaccess file extension rules bypass via case variation on case-insensitive filesystems","details":"## Summary\n\nThe 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`).\n\n## Affected Versions\n\n- Grav 2.0.1 (latest stable as of June 2026) — confirmed\n- Grav 1.7.x — likely affected (same `.htaccess` rules)\n- All versions shipping the current `webserver-configs/htaccess.txt`\n\n## Affected Component\n\nFile: `.htaccess` (root of Grav installation)\nReference: `webserver-configs/htaccess.txt`\n\n## Affected Rules (lines 68, 70, 72)\n\n```apache\n# Line 68 — system/vendor file types\nRewriteRule ^(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]\n\n# Line 70 — user file types\nRewriteRule ^(user)/(.*)\\.(txt|md|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ error [F]\n\n# Line 72 — .md files globally\nRewriteRule \\.md$ error [F]\n```\n\nAll three rules use `[F]` without `[NC]`, making the extension match case-sensitive.\n\n## Steps to Reproduce\n\n1. Install Grav on a system with a case-insensitive filesystem:\n   - Windows (native WAMP/XAMPP)\n   - macOS (default HFS+)\n   - Docker on Windows/macOS with volume mounts (e.g., `./data:/var/www/html`)\n\n2. Create or use any plugin that stores sensitive data in its YAML config (e.g., API keys):\n   ```\n   user/plugins/my-plugin/my-plugin.yaml\n   ```\n\n3. Request the file with a case-varied extension:\n   ```\n   GET /user/plugins/my-plugin/my-plugin.YAML HTTP/1.1\n   ```\n\n4. **Expected**: HTTP 403 Forbidden\n5. **Actual**: HTTP 200 OK — full file contents returned, including any API keys or sensitive configuration\n\n## Impact\n\n- **Information disclosure**: Plugin configuration files (`.yaml`) containing API keys, credentials, or sensitive settings can be read by unauthenticated users\n- **Source code exposure**: PHP source files can be downloaded (instead of executed) when requested with `.PHP` extension on some configurations\n- **Configuration exposure**: `user/config/system.yaml`, `user/config/site.yaml`, and other system configuration files are accessible\n\n## Fix\n\nAdd the `[NC]` flag to the three affected rules:\n\n```apache\nRewriteRule ^(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]\nRewriteRule ^(user)/(.*)\\.(txt|md|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ error [F,NC]\nRewriteRule \\.md$ error [F,NC]\n```\n\nThe `[NC]` flag makes the extension matching case-insensitive, covering `.YAML`, `.Yaml`, `.PHP`, `.Json`, etc.\n\n## Mitigating Factors\n\n- On native Linux with ext4 filesystem (case-sensitive), the attack does not work because Apache cannot resolve the uppercase filename to the actual file\n- Grav 2.0's Twig sandbox blocks access to `plugins` config subtree from page content, preventing SSTI-based config exfiltration\n- 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\n\n## Environment\n\n- Grav: 2.0.1\n- PHP: 8.3\n- Apache: 2.4 with mod_rewrite\n- OS: Docker (php:8.3-apache) with volume mounted from Windows 10 (NTFS)\n- Tested: June 2026\n\n## Reporter\n\nSisnetic","published":"2026-08-19T15:46:59.472Z","modified":"2026-09-11T03:31:01.324098754Z","cvss":null,"epss":{"score":0.00402,"percentile":0.33193,"asOf":"2026-08-26"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"getgrav/grav","fixedVersion":"2.0.4"}],"fix":{"url":"https://github.com/getgrav/grav/commit/8c9d1e7b6fd66ecea80a4bc3783fd41d36e22fb1","label":"getgrav/grav@8c9d1e7"},"references":[{"type":"WEB","url":"https://github.com/getgrav/grav/releases/tag/2.0.4"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/62xxx/CVE-2026-62673.json"},{"type":"ADVISORY","url":"https://github.com/getgrav/grav/security/advisories/GHSA-vwg3-w8w3-pc79"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62673"},{"type":"FIX","url":"https://github.com/getgrav/grav/commit/8c9d1e7b6fd66ecea80a4bc3783fd41d36e22fb1"},{"type":"PACKAGE","url":"https://github.com/getgrav/grav"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-09-11T03:31:01.324098754Z"}}