{"id":"CVE-2026-62230","aliases":["CVE-2026-62230","GHSA-vwg3-w8w3-pc79"],"related":["CVE-2026-62673"],"kind":"vulnerability","state":"published","title":"Grav < 2.0.4 File Access Bypass via Case Variation","summary":"Grav before 2.0.4 ships a default .htaccess (and reference webserver-configs/htaccess.txt) whose rules blocking access to sensitive file types (.yaml, .php, .json, etc.) lack the [NC] flag, making extension matching case-sensitive. On case-insensitive filesystems (Windows/NTFS, macOS/HFS+, or Docker volume mounts), an unauthenticated attacker can request these files with uppercase or mixed-case extensions (e.g., .YAML, .PHP) to bypass the restrictions and read sensitive configuration files that may contain API keys and credentials.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Grav before 2.0.4 ships a default .htaccess (and reference webserver-configs/htaccess.txt) whose rules blocking access to sensitive file types (.yaml, .php, .json, etc.) lack the [NC] flag, making extension matching case-sensitive. On case-insensitive filesystems (Windows/NTFS, macOS/HFS+, or Docker volume mounts), an unauthenticated attacker can request these files with uppercase or mixed-case extensions (e.g., .YAML, .PHP) to bypass the restrictions and read sensitive configuration files that may contain API keys and credentials.","source":"cvelist"},{"lang":"en","text":"## 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","format":"markdown","source":"ghsa"},{"lang":"es","text":"Grav anterior a la versión 2.0.4 incluye un archivo .htaccess predeterminado (y el archivo de referencia webserver-configs/htaccess.txt) cuyas reglas que bloquean el acceso a tipos de archivos sensibles (.yaml, .php, .json, etc.) carecen de la bandera [NC], lo que hace que la coincidencia de la extensión distinga entre mayúsculas y minúsculas. En sistemas de archivos que no distinguen entre mayúsculas y minúsculas (Windows/NTFS, macOS/HFS+, o montajes de volumen de Docker), un atacante no autenticado puede solicitar estos archivos con extensiones en mayúsculas o con una combinación de mayúsculas y minúsculas (por ejemplo, .YAML, .PHP) para eludir las restricciones y leer archivos de configuración sensibles que pueden contener claves de API y credenciales.","source":"nvd"}],"published":"2026-07-17T00:07:06.995Z","modified":"2026-10-24T20:10:00.137Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-178"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"2.0.4","status":"affected"},{"type":"semver","version":"2.0.4","status":"unaffected"}],"vendor":"getgrav","product":"grav","repo":"https://github.com/getgrav/grav","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.0.4"}],"ecosystem":"Packagist","package":"getgrav/grav","purl":"pkg:composer/getgrav/grav","source":"ghsa"}],"references":[{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-vwg3-w8w3-pc79","tags":["exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/grav-file-access-bypass-via-case-variation","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62673","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/getgrav/grav/commit/8c9d1e7b6fd66ecea80a4bc3783fd41d36e22fb1","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/getgrav/grav","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/getgrav/grav/releases/tag/2.0.4","tags":["web"],"sources":["ghsa"]}],"credits":["replit-svg"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-07-17T14:08:46.289Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-62230","url":"https://www.cve.org/CVERecord?id=CVE-2026-62230","licence":"CVE Terms of Use","modified":"2026-10-08T15:23:43.577Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vwg3-w8w3-pc79","url":"https://github.com/advisories/GHSA-vwg3-w8w3-pc79","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:14.821Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-62230","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62230","licence":"Public domain","modified":"2026-10-24T20:10:00.137Z"}],"updatedAt":"2026-11-25T22:59:28.462Z","epss":{"score":0.00381,"percentile":0.34257,"date":"2026-12-01T12:00:22.000Z"}}