Impact
Grav before version 2.0.2 is vulnerable to a Twig sandbox bypass, specifically a code‑injection style flaw (CWE‑94). The exploit allows a page author—any user with edit access to the site content, or anyone able to write to the user/pages directory—to call grav.offsetGet('config'), which returns the real, unredacted configuration object. This object can then be serialized by the sandbox‑permitted filters json_encode, print_r, or yaml_encode, exposing the entire configuration tree including SMTP credentials, API keys, and other plugin secrets. The vulnerability does not allow arbitrary code execution; it is a disclosure of sensitive data that the application otherwise protects through the sandbox.
Affected Systems
All Grav versions prior to 2.0.2 are affected. Unlike the initial mitigation, the fix introduced in version 2.0.2 is incomplete, so the vulnerability may persist in that release. Administrators should verify if a later version fully resolves the issue and consider upgrading accordingly.
Risk and Exploitability
The CVSS score of 7.1 indicates a high impact vulnerability. The EPSS score of <1% suggests a very low probability of exploitation at present. The vulnerability is not listed in CISA’s KEV catalog. Likely attack vectors involve a page author or writer in the user/pages directory creating a page that calls grav.offsetGet('config') and using json_encode, print_r, or yaml_encode to serialize the real Config object. This would expose all configuration secrets. Because the attacker needs authoring privileges or write access to the pages directory, the risk is limited to those users, but if successful the attacker can exfiltrate full configuration data.
OpenCVE Enrichment