# CVE-2026-72698: Grav CMS Twig sandbox bypass via system/site/theme arrays

Source: https://junglewise.ai/threats/cve-2026-72698-grav-cms-twig-sandbox-bypass-via-system-site-theme-arrays  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-25. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-72698 · Severity: medium · CVSS 6.5 · Published 2026-08-25

Grav CMS allows page content editors to read sensitive system configuration values through Twig templating, including cached credentials and secrets, because the Twig sandbox only restricts object property access but cannot prevent array key access. An attacker with permission to edit page content can extract secrets like database passwords and API keys that were intended to be protected from unprivileged users.

Technologies: [getgrav/grav (Packagist)](https://junglewise.ai/threats/technologies/getgrav-grav). Vendors: [Packagist](https://junglewise.ai/threats/vendors/packagist).

## Quick answers

**Is CVE-2026-72698 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-72698 being exploited in the wild.

**How severe is CVE-2026-72698?** Medium severity, with a CVSS score of 6.5, published 25 August 2026.

**Which products and versions are affected?** getgrav/grav (Packagist) < 2.0.16, ECOSYSTEM:introduced=0,fixed=2.0.16.

**Is there a fix for CVE-2026-72698?** Yes. getgrav/grav (Packagist): upgrade to 2.0.16 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-72698 attacked?** It is attacked over the network, in a web application.

**Am I affected by CVE-2026-72698?** Check whether you run getgrav/grav (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- getgrav/grav (Packagist): upgrade to 2.0.16 or later

  ```sh
  composer require getgrav/grav:^2.0.16
  ```


## Technical details

The vulnerability is a sandbox bypass in Grav's Twig template rendering. The `Twig::init()` method copies raw PHP arrays (`system`, `site`, `theme`) from the configuration into the Twig variable set. When `processPage()` builds the sandbox environment for editor-authored content, it replaces only the `config` variable with a filtered facade object but leaves the raw arrays untouched. Twig's sandbox `SecurityPolicy` only restricts method calls and property access on objects; it cannot prevent array subscript access in templates. An attacker with page-content edit access (controlled by `security.twig_content.process_enabled`) can read `{{ system.cache.redis.password }}` and other nested secrets from these unfiltered arrays. The `config_denied_paths` mechanism, which was added to prevent similar leaks via the `config` variable, does not apply to plain arrays. The fix is to strip or replace these variables in sandboxed renders using a facade pattern similar to the existing `SandboxConfig` object.

## Affected products

- Grav CMS 2.0.15 and likely other versions

## Identifiers

- CVE-2026-72698
- GHSA-p597-crqc-m349

## Timeline

- 2026-09-17: disclosed: Advisory published
- 2026: other: Known CVE-2026-72698 assigned

## Related threats

- [Grav cross-site scripting in Twig sandbox asset methods](https://junglewise.ai/threats/cve-2026-86197-grav-cross-site-scripting-in-twig-sandbox-asset-methods)
- [Grav Twig sandbox config exfiltration via offsetGet and dump filters](https://junglewise.ai/threats/cve-2026-61842-grav-twig-sandbox-config-exfiltration-via-offsetget-and-dump)
- [Grav ZipArchiver decompression bomb via missing extraction limits](https://junglewise.ai/threats/cve-2026-61690-grav-ziparchiver-decompression-bomb-via-missing-extraction-limits)
- [Grav incomplete Twig sandbox denylist information disclosure](https://junglewise.ai/threats/grav-incomplete-twig-sandbox-denylist-information-disclosure-e903bd3b)
- [Grav UserInterface offsetGet/offsetExists Twig sandbox bypass](https://junglewise.ai/threats/grav-userinterface-offsetget-offsetexists-twig-sandbox-bypass-f709468e)
