All vulnerabilities

Servers and applications

GHSA-rfr9-7h4p-gx2x

Twig content sandbox leaks the full configuration through print_r

Severity
High
Published
2 Sept 2026
Last changed
2 Sept 2026
Added to UpHeron
3 Nov 2026
Fixed in
2.0.22
Weakness
Information exposure (CWE-200)Protection mechanism failure (CWE-693)
Sources
Project advisories (GitHub)

Description

A user with page-edit rights can read Grav's entire merged configuration — including plugin secrets and other values the content sandbox is specifically built to hide — by rendering {{ config|print_r }} in page content.

This is an incomplete fix for GHSA-mc5q-6hpj-rp7j. That advisory added a guard to the dump and serialize filters (print_r, vardump, json_encode, yaml_encode, string) so they would refuse objects inside sandboxed content. The guard has never run.

GravExtension::assertSandboxDumpSafe() decided whether it was inside a sandboxed render by calling SandboxExtension::isSandboxed() with no Source argument. That form of the call reports only the global sandbox flag.

Grav never turns the sandbox on globally. It registers a SandboxExtension carrying a GravSourcePolicy, which decides per template: anything loaded as @Page: or @Var: is sandboxed, a theme file on disk is not.

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

Affected software

SoftwareAffected versions
GravServers and applications · github:getgrav/grav
  • From 2.0.0-rc.1 before 2.0.22

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