All vulnerabilities

Servers and applications

GHSA-p597-crqc-m349

The system, site, and theme Twig variables bypass the content sandbox entirely and are never covered by config_denied_paths

Severity
Medium 6.5
Published
10 Aug 2026
Last changed
10 Aug 2026
Added to UpHeron
3 Nov 2026
Fixed in
2.0.16
Weakness
Information exposure (CWE-200)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Read data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Sources
Project advisories (GitHub)

Description

Grav\Common\Twig\Twig::init() unconditionally puts the raw system, site, and theme config arrays into $this->twig_vars. Twig::processPage() builds the variables for the sandboxed, editor-authored page-content render by copying that same base array ($sandbox_vars = $twig_vars;) and replacing only the config key with a filtered SandboxConfig facade. The system, site, and theme keys are carried into the sandboxed render completely untouched.

Because these are plain PHP arrays, not objects, Twig's sandbox SecurityPolicy (the allowed_classes/allowed_methods/allowed_properties lists in system/config/security.yaml) has no jurisdiction over them at all. The sandbox only gates method calls and property access on objects. Dot notation or subscript access on an array is always allowed by Twig regardless of any sandbox policy.

From getgrav/grav's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
GravServers and applications · github:getgrav/grav
  • Every version before 2.0.16

About Grav

free software content management system written in PHP

From Wikidata, CC0 1.0.
Monthly downloads (Packagist)
1,748Packagist, 15 Nov 2026
Total downloads (Packagist)
92,444Packagist, 15 Nov 2026
GitHub stars
15,725GitHub, 15 Nov 2026
Forks
1,430GitHub, 15 Nov 2026
Latest release
2.2.29GitHub, 15 Nov 2026
Released
11 Nov 2026GitHub
License
MIT LicenseWikidata
Written in
PHPWikidata
First published on GitHub
2 Aug 2014GitHub

References