Hoch

Grav: .htaccess file extension rules bypass via case variation on case-insensitive filesystems

  • Veröffentlicht: 19.08.2026
  • Aktualisiert: 11.10.2026 10:22

Summary

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).

Affected Versions

  • 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

Affected Component

File: .htaccess (root of Grav installation) Reference: webserver-configs/htaccess.txt

Affected Rules (lines 68, 70, 72)

apache
# 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.

Steps to Reproduce

  1. 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)
  2. Create or use any plugin that stores sensitive data in its YAML config (e.g., API keys):

    user/plugins/my-plugin/my-plugin.yaml
  3. Request the file with a case-varied extension:

    GET /user/plugins/my-plugin/my-plugin.YAML HTTP/1.1
  4. Expected: HTTP 403 Forbidden

  5. Actual: HTTP 200 OK — full file contents returned, including any API keys or sensitive configuration

Impact

  • 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

Fix

Add the [NC] flag to the three affected rules:

apache
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.

Mitigating Factors

  • 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

Environment

  • 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

Reporter

Sisnetic

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Composer-Paket getgrav/grav < 2.0.4 2.0.4

Verweise

CVSS-Wert -
CVSS-Vektor
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
Schwäche (CWE)
CWE-178
Plattform
Composer
Paket
getgrav/grav
Veröffentlicht
19.08.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-vwg3-w8w3-pc79 - CC BY 4.0

Schwachstellenhistorie: getgrav/grav

Alle veröffentlichten Schwachstellen dieses Pakets (Composer-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (99) im Archiv
Einträge insgesamt
99
Erste → letzte
11.2019 09.2026
Ohne Fix
6
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 7
  • Hoch 47
  • Mittel 41
  • Niedrig 4

Veröffentlichungen pro Jahr

  1. 2019: 1
  2. 2020: 1
  3. 2021: 4
  4. 2022: 10
  5. 2023: 5
  6. 2024: 8
  7. 2025: 23
  8. 2026: 47
Schweregrad:
  1. Hoch · 8.8 CVE-2026-72819 < 2.0.13 2.0.13
  2. Grav: .htaccess file extension rules bypass via case variation on case-insensitive filesystems dieser Eintrag
    Hoch CVE-2026-62230 < 2.0.4 2.0.4
  3. Hoch CVE-2026-53653 >= 2.0.0-beta.1, < 2.0.0-rc.8, < 1.7.53 2.0.0-rc.8, 1.7.53
  4. Hoch · 8.9 CVE-2026-42611 < 2.0.0-beta.2 2.0.0-beta.2
  5. Hoch · 8.5 CVE-2026-42612 < 2.0.0-beta.2 2.0.0-beta.2
  6. Kritisch · 9.4 CVE-2026-42613 < 2.0.0-beta.2 2.0.0-beta.2
  7. Kritisch · 9.1 CVE-2025-66844 <= 1.7.49.5 keine Korrektur
  8. Hoch CVE-2025-66298 < 1.8.0-beta.27 1.8.0-beta.27
  9. Hoch CVE-2025-66294 < 1.8.0-beta.27 1.8.0-beta.27
  10. Hoch · 8.5 CVE-2025-66300 < 1.8.0-beta.27 1.8.0-beta.27
  11. Hoch · 8.8 CVE-2025-66299 < 1.8.0-beta.27 1.8.0-beta.27
  12. Hoch · 8.5 CVE-2024-34082 < 1.7.46 1.7.46
  13. Hoch · 8.8 CVE-2024-28119 < 1.7.45 1.7.45
  14. Hoch · 8.8 CVE-2024-28118 < 1.7.45 1.7.45
  15. Hoch · 8.8 CVE-2024-28117 < 1.7.45 1.7.45
Mehr anzeigen (14) 40 von 54 angezeigt

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.