Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-92917

CVE-2026-92917: Grav CMS Information Disclosure Vulnerability

CVE-2026-92917 is an information disclosure flaw in Grav CMS that allows authenticated users to bypass Twig sandbox protections and expose sensitive configuration data. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2026-92917 Overview

CVE-2026-92917 is an information disclosure vulnerability in Grav, a flat-file content management system (CMS). The flaw affects Grav versions 2.0.0-rc.1 through 2.0.21 and allows authenticated users with page-edit rights to bypass the Twig content sandbox. Attackers can render dump filters such as print_r inside page content and extract Grav's entire merged configuration, including plugin secrets, SMTP credentials, API tokens, webhook secrets, and cache backend passwords. The issue is tracked under [CWE-200] (Exposure of Sensitive Information) and is fixed in Grav 2.0.22.

Critical Impact

An authenticated editor can dump the full server configuration, exposing credentials that enable lateral movement to mail servers, external APIs, and cache backends.

Affected Products

  • Grav CMS versions 2.0.0-rc.1 through 2.0.21
  • Grav installations with Twig processing enabled for page content
  • Grav 1.7 is not affected (ships no Twig content sandbox)

Discovery Timeline

  • 2026-09-17 - CVE-2026-92917 published to NVD
  • 2026-09-17 - Last updated in NVD database

Technical Details for CVE-2026-92917

Vulnerability Analysis

Grav's Twig content sandbox is designed to restrict dangerous filters when rendering user-authored page content. The sandbox previously added a guard in GHSA-mc5q-6hpj-rp7j to block dump and serialize filters including print_r, vardump, json_encode, yaml_encode, and string. This guard never executes because of a flawed sandbox state check, allowing dump filters to run against sensitive objects. The vulnerability falls under Information Disclosure and Broken Access Control categories.

Root Cause

The guard function GravExtension::assertSandboxDumpSafe() determines sandbox state by calling SandboxExtension::isSandboxed() without a Source argument. This variant reports only the global sandbox flag, which Grav never enables. Grav enables sandboxing per-template rather than globally, so the check always returns false and the dump filter block is bypassed.

Attack Vector

An authenticated user with page-edit rights inserts {{ config|print_r }} into page content with Twig processing enabled. The print_r filter reflects the real Config object held in a private property of the SandboxConfig facade, bypassing the facade's path redaction logic. Rendering the page returns the fully merged configuration in the HTTP response, including secrets from every installed plugin.

The vulnerability requires network access to the Grav admin interface and authenticated page-edit privileges. No user interaction is required beyond publishing or previewing the crafted page. See the GitHub Security Advisory GHSA-rfr9-7h4p-gx2x and the VulnCheck Advisory for Grav Configuration Disclosure for full technical details.

Detection Methods for CVE-2026-92917

Indicators of Compromise

  • Page content or revision history containing Twig expressions with print_r, vardump, json_encode, yaml_encode, or string filters applied to config, system, or plugins variables.
  • Rendered pages returning large payloads containing keys such as smtp, api_token, webhook, or password in serialized form.
  • Unexpected edits to pages by low-privilege editor accounts, particularly on pages with Twig processing enabled.

Detection Strategies

  • Audit the Grav pages directory (user/pages/) for Twig expressions invoking dump-family filters against configuration variables.
  • Monitor web server response bodies for configuration key patterns typical of Grav's merged config output.
  • Review Grav admin plugin audit logs for page-edit activity by non-administrator accounts.

Monitoring Recommendations

  • Alert on outbound requests from the Grav host to unexpected destinations after credential exposure events.
  • Track authentication anomalies on SMTP servers, API endpoints, and cache backends whose credentials are stored in Grav plugin configurations.
  • Enable file integrity monitoring on user/pages/ and user/config/ directories.

How to Mitigate CVE-2026-92917

Immediate Actions Required

  • Upgrade Grav to version 2.0.22 or later, where the affected filters are registered with Twig's needs_is_sandboxed flag.
  • Rotate all secrets present in Grav plugin configurations, including SMTP credentials, API tokens, webhook secrets, and cache backend passwords.
  • Review the page-edit permission assignments and revoke access from accounts that do not require content authoring.

Patch Information

Grav 2.0.22 fixes the vulnerability by registering the affected filters (print_r, vardump, json_encode, yaml_encode, string) with Twig's needs_is_sandboxed flag. This ensures the sandbox state check reflects per-template sandbox activation rather than the unused global flag. Details are published in the GitHub Security Advisory GHSA-rfr9-7h4p-gx2x.

Workarounds

  • Disable Twig processing for page content in user/config/system.yaml by setting pages.twig_first: false and pages.process.twig: false where the workflow permits.
  • Restrict page-edit rights to trusted administrators until the upgrade is applied.
  • Deploy a web application firewall rule that inspects saved page bodies for Twig dump filter patterns targeting configuration variables.
bash
# Configuration example: disable Twig processing on page content in user/config/system.yaml
pages:
  process:
    twig: false
  twig_first: false

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.