Description
Grav before 2.0.2 contains a Twig sandbox bypass that allows a page author (any admin.pages user, or anyone able to write to user/pages) to exfiltrate configuration secrets. Although the sandbox replaces the 'config' variable with a redacted facade and strips Config::get/toArray from the method allowlist, the raw container remains accessible via the allow-listed grav.offsetGet('config'), which returns the real Config object. Allow-listed object-dumping filters (json_encode, print_r, yaml_encode) then serialize that object at the PHP level without invoking the sandbox method gate, exposing the full config tree including plugin secrets such as SMTP credentials, API keys, and plugin DB credentials. This is an incomplete fix for GHSA-j274-39qw-32c9.
Published: 2026-07-10
Score: 7.1 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

Generated by OpenCVE AI on July 29, 2026 at 10:50 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Grav to the latest version that fully resolves the sandbox bypass (currently newer than 2.0.2).
  • Restrict write permissions on the user/pages directory to trusted administrators only to prevent unauthorized page creation or modification.
  • If possible, remove the allowed serialization filters (json_encode, print_r, yaml_encode) for Config objects, or disable grav.offsetGet entirely in the site's configuration.

Generated by OpenCVE AI on July 29, 2026 at 10:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 10 Jul 2026 14:45:00 +0000

Type Values Removed Values Added
Description Grav before 2.0.2 contains a Twig sandbox bypass that allows a page author (any admin.pages user, or anyone able to write to user/pages) to exfiltrate configuration secrets. Although the sandbox replaces the 'config' variable with a redacted facade and strips Config::get/toArray from the method allowlist, the raw container remains accessible via the allow-listed grav.offsetGet('config'), which returns the real Config object. Allow-listed object-dumping filters (json_encode, print_r, yaml_encode) then serialize that object at the PHP level without invoking the sandbox method gate, exposing the full config tree including plugin secrets such as SMTP credentials, API keys, and plugin DB credentials. This is an incomplete fix for GHSA-j274-39qw-32c9.
Title Grav before 2.0.2 Config Exfiltration via offsetGet Filter
First Time appeared Getgrav
Getgrav grav
Weaknesses CWE-94
CPEs cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*
Vendors & Products Getgrav
Getgrav grav
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

cvssV4_0

{'score': 7.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-10T15:46:20.929Z

Reserved: 2026-07-09T14:06:14.016Z

Link: CVE-2026-61450

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-29T11:00:13Z

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')