Grav CMS Twig Sandbox Bypass via Configuration Exposure
CVE-2026-92917 allows an authenticated user with page-edit privileges in Grav CMS 2.0.0-rc.1 through 2.0.21 to bypass Twig sandboxing and exfiltrate the full application configuration, including API keys and credentials.
CVE search metadata
CVE search record: CVE-2026-92917. Severity: high. CVSS: 7.5. KEV: no. Product: Grav (2.0.0-rc.1 through 2.0.21), Grav (<= 2.0.15). Brief: Grav CMS Twig Sandbox Bypass via Configuration Exposure. Brief link: https://feed.craftedsignal.io/briefs/2026-09-grav-cms-sandbox-bypass/
What's new
- 1. added coverage for Grav (<= 2.0.15) Sep 18, 01:12 via ghsa
Grav CMS, a popular flat-file content management system, contains a vulnerability (CVE-2026-92917) within its Twig content sandbox implementation in versions 2.0.0-rc.1 through 2.0.21. The vulnerability stems from an incorrect implementation of the sandbox security check in GravExtension::assertSandboxDumpSafe(). Instead of checking if specific filters like print_r, json_encode, or yaml_encode are sandboxed relative to the source, the extension queries the global sandbox flag, which remains permanently disabled in Grav. Consequently, the safety guards intended to restrict data dumping fail. An authenticated attacker with page-edit permissions can leverage this by embedding Twig template code within a page. When rendered, the application processes the request, ignores the sandbox restrictions, and outputs the entire internal Config object, including sensitive secrets stored in private properties that are normally redacted. This exposure allows attackers to harvest SMTP credentials, API tokens, webhook secrets, and cache backend passwords. The vulnerability is resolved in Grav version 2.0.22, where the filters are correctly registered with Twig’s needs_is_sandboxed flag.
Impact
Successful exploitation allows an authenticated user to gain access to sensitive application configuration data. This includes administrative secrets required for third-party integrations and backend services. Exposure of these credentials can facilitate further compromise of internal infrastructure, external services, and data exfiltration, significantly increasing the attacker's footprint within the environment.
Recommendation
- Upgrade all instances of Grav CMS to version 2.0.22 or later immediately to patch CVE-2026-92917.
- Audit web application logs for administrative users accessing Twig-related rendering functions, specifically looking for attempts to use
print_r,vardump, orjson_encodefilters within page content updates. - Revoke and rotate all secrets (SMTP, API tokens, webhooks) found in the Grav configuration if a compromise is suspected to have occurred between version 2.0.0-rc.1 and 2.0.22.
Immediate actions
Upgrade Grav CMS to version 2.0.22
Mitigations
Rotate all API keys and credentials contained in the Grav configuration
CVE-2026-92917