Skip to content

H3-2026-1090

Grav CMS htaccess Rewrite Override Sensitive File Exposure Vulnerability

Category SECURITY_MISCONFIGURATION
Base Score 7.5

Description

Grav CMS ships a root .htaccess that uses mod_rewrite rules to block direct web access to sensitive files, such as .yaml, .md, .twig, and .php files, under the user/ directory. Apache mod_rewrite rules are not inherited across subdirectories, so any plugin or theme that ships its own .htaccess enabling RewriteEngine silently replaces the root ruleset for that folder. Remote attackers can request a plugin or theme configuration file directly once its containing folder has lost the root protection, retrieving its raw contents over HTTP. The condition requires only that one installed plugin or theme carries its own RewriteEngine-enabling .htaccess, which is common among third-party extensions.

Impact

Successful exploitation discloses plugin and theme configuration files that may contain credentials, API keys, and other internal settings. Any installed extension with its own rewrite rules can expose its full configuration to anonymous requests. Instances running many third-party plugins or themes face the broadest exposure.

References