CVE-2026-72698 in Grav
Summary
by MITRE • 08/25/2026
Grav CMS before 2.0.16 fails to filter system, site, and theme configuration arrays in sandboxed Twig renders, allowing content editors to read sensitive configuration values. Attackers with page-content edit access can access raw configuration arrays including secrets like cache credentials by using dot notation in Twig templates, bypassing the config_denied_paths restrictions.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 08/25/2026
The vulnerability identified in Grav CMS prior to version 2.0.16 represents a critical failure in input validation and context-aware output encoding within its templating engine. Specifically, the issue resides in how the system handles configuration arrays when rendered inside sandboxed Twig templates. While Grav employs a security model designed to restrict access to sensitive data through mechanisms such as config_denied_paths, this protection mechanism was found to be bypassable due to improper filtering of system, site, and theme configuration structures during the rendering process. The core technical flaw lies in the ability of content editors with page-content edit privileges to inject specific syntax into Twig templates that allows for direct traversal and extraction of raw configuration arrays. This capability effectively neutralizes the intended isolation between user-generated content and backend administrative data.
From a technical perspective, the exploitation vector relies on the use of dot notation within Twig template code. By constructing variable access patterns that traverse nested array structures, an attacker can request specific keys from the global configuration objects. Because the sandboxed environment did not adequately sanitize or restrict these traversal operations against the denied paths list, sensitive information such as database credentials, cache secrets, and other high-value tokens could be read directly by the authenticated user. This behavior indicates a fundamental weakness in how the application context is passed to the view layer, allowing data that should remain internal to leak into publicly accessible rendered content or API responses depending on the specific implementation of the template logic.
The operational impact of this vulnerability is severe for any organization relying on Grav CMS for web hosting where multiple users have editing privileges. An attacker with access to edit page content can escalate their privilege level from a standard contributor to an information disclosure actor without needing administrative rights or exploiting server-side software vulnerabilities. The exfiltration of cache credentials and other secrets compromises the integrity and confidentiality of the entire application stack. This data could be used for further attacks, including unauthorized database access, session hijacking if tokens are exposed, or disrupting service availability by manipulating cached content configurations. The risk is particularly acute in multi-tenant environments or collaborative projects where trust boundaries between different user roles may not be strictly enforced at the code level.
This vulnerability aligns with CWE-200, which classifies it as an Information Exposure Vulnerability, specifically involving sensitive information disclosure through improper access controls. In terms of offensive security frameworks, this behavior maps to ATT&CK technique T1530, Data from Cloud Storage Object or Service, where the attacker accesses data stored in a cloud-based service or application configuration without proper authorization. It also reflects aspects of CWE-798, Use of Hard-coded Credentials, if those credentials are exposed via the template rendering process. The root cause is attributed to insufficient validation of user-supplied input when interacting with internal system objects, highlighting the need for stricter sandboxing rules in templating engines that handle dynamic content generation.
To mitigate this risk, organizations running Grav CMS must immediately upgrade to version 2.0.16 or later, where these filtering mechanisms have been corrected to properly enforce access restrictions on configuration arrays within Twig renders. For environments unable to patch immediately due to dependency constraints, administrators should review the config_denied_paths settings and consider implementing additional server-side validation layers that intercept template rendering requests before they reach the Twig engine. Furthermore, adopting a principle of least privilege for content editors is essential; restricting who can edit page templates or execute custom code within the CMS interface significantly reduces the attack surface. Regular security audits focusing on how user input interacts with internal configuration objects will help prevent similar bypasses in future updates and ensure that sandboxed environments remain effective against insider threats or compromised accounts.