CVE-2026-62673: Grav .htaccess File Extension Rules Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-vwg3-w8w3-pc79
CWE-178
Published
Advisory Summary

CVE-2026-62673 is a HIGH .htaccess file extension rules bypass vulnerability (CWE-178: Improper Handling of Case Sensitivity) affecting Grav libraries in the Packagist ecosystem. The issue involves .htaccess file extension rules bypass via case variation on case-insensitive filesystems. Remediation is available by upgrading affected packages to version 2.0.4.

CVE-2026-62673 at a Glance

CVE Identifier CVE-2026-62673
GHSA Identifier GHSA-vwg3-w8w3-pc79
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-178: Improper Handling of Case Sensitivity
Affected Product Grav
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-62673

To remediate this vulnerability, upgrade all affected Grav dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

getgrav/grav fixed: 2.0.4
Upgrade getgrav/grav to 2.0.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for getgrav/grav

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-62673, inspect your project dependencies for Grav:

inspect dependencies for getgrav/grav

Analyze the terminal output to locate any version of Grav in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-178: Improper Handling of Case Sensitivity, where the product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results. In Grav, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-62673 Affected Grav Versions

1 component(s)
Fixed Versions:
2.0.4
Product / Package Ecosystem Affected Versions Fixed Version
getgrav/grav
Packagist
< 2.0.4
2.0.4

References

Frequently Asked Questions

What is CVE-2026-62673?
CVE-2026-62673 is a security vulnerability in Grav involving .htaccess file extension rules bypass via case variation on case-insensitive filesystems under CWE-178: Improper Handling of Case Sensitivity.
Which Grav versions are affected?
Affected versions include releases prior to 2.0.4 across affected packages: getgrav/grav.
What version fixes CVE-2026-62673?
Upgrading to 2.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is getgrav/grav affected?
Yes, getgrav/grav is affected in releases prior to 2.0.4. Upgrade your dependency to 2.0.4 or later.
What CWE is associated with CVE-2026-62673?
CVE-2026-62673 is classified under CWE-178: Improper Handling of Case Sensitivity (The product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.).
How can I check Packagist dependencies for CVE-2026-62673?
Run the dependency tree command: 'inspect dependencies for getgrav/grav'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vwg3-w8w3-pc79",
  "modified" : "2026-08-19T19:32:38Z",
  "published" : "2026-08-19T19:32:38Z",
  "aliases" : [ "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",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getgrav/grav"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "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" : "WEB",
    "url" : "https://github.com/getgrav/grav/commit/8c9d1e7b6fd66ecea80a4bc3783fd41d36e22fb1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getgrav/grav"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getgrav/grav/releases/tag/2.0.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-178" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-19T19:32:38Z",
    "nvd_published_at" : "2026-08-19T16:18:20Z"
  }
}