Grav CMS CVE-2026-42610
MEDIUMSeverity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Lifecycle Timeline
2DescriptionGitHub Advisory
Summary
Information disclosure exists in Grav CMS v1.8.0-beta.29. Despite previous security patches (notably in v1.8.0-beta.27/28) aimed at restricting sensitive object access within the Twig environment, the Accounts Service remains exposed.
A low-privileged user (EX: Content Editor with only pages.update permissions) can bypass the existing Twig sandbox restrictions by utilizing the grav['accounts'] service. Attacker can programmatically load administrative user objects and extract sensitive data, including Bcrypt password hashes and the security salt.
Affected version
Grav CMS: v1.8.0-beta.29 (and earlier 1.8.x beta versions).
Note: This vulnerability persists even after the vendor attempted to mitigate similar SSTI vectors in earlier beta releases.
Steps to Reproduce
- Create a low-privileged account (MY CASE IS 'editor_chen') with permissions limited to admin.login and basic page management (create, update, list). Ensure all administrative permissions (Configuration, User Accounts, ...) are explicitly Denied.
- Login to the Admin panel using
editor_chen. Navigate to Pages and edit theHomepage. - Under the Advanced tab, ensure Process Twig is enabled .
- In the Content tab, inject the following Twig payload designed to bypass the
isDangerousFunctionfilter by accessing the internal service container:
---
title: Information Disclosure Test
process:
twig: true
---
# Security Audit Results
- Admin Password Hash: {{ grav['accounts'].load('admin').get('hashed_password') }}
- Security Salt: {{ grav.config.get('security.salt') }}<img width="1176" height="618" alt="GRAV" src="https://github.com/user-attachments/assets/7970216a-2dc6-4d1b-8dfd-b64f3712c9c5" />
- Click Save. And navigate to the public page (
http://localhost:8000/home). Page will render and display the administrator's Bcrypt hash and the system security salt.
<img width="1278" height="462" alt="GRAV2" src="https://github.com/user-attachments/assets/33b7b894-6ae3-4d29-bd2d-8004e9b343e0" />
PoC
---
title: Information Disclosure Test
process:
twig: true
---
# Security Audit Results
- Admin Password Hash: {{ grav['accounts'].load('admin').get('hashed_password') }}
- Security Salt: {{ grav.config.get('security.salt') }}Impact
Attackers can obtain the password hashes of all registered users, including Super Administrators.
Extracted hashes can be subjected to offline brute-force or dictionary attacks (EX: USE Hashcat)
Video
Pls refer to the attached video <video src="https://github.com/user-attachments/assets/74d5ae41-7911-4099-b2cc-e6c51b27c68c" controls="controls" style="max-width: 100%;"> </video>
---
Maintainer note - fix applied (2026-04-24)
Fixed in Grav core on the 2.0 branch: commit d904efc33 - will ship in 2.0.0-beta.2.
What changed: the HMAC key formerly stored as security.salt in user/config/security.yaml has moved out of the Config tree into user/config/security-private.php. On upgrade, the existing salt value is migrated into the new file on first request (preserving CSRF nonces and sessions) and the key is scrubbed from both the live Config object and the on-disk YAML - so {{ grav.config.get('security.salt') }} from a sandboxed Twig template now returns null. The .php extension is blocked from web access by the default user/*.php htaccess rule; the file contains only a return statement, so direct PHP exec produces no output either.
The PoC's password-hash half (grav['accounts'].load('admin').get('hashed_password')) was already covered by the new Twig content sandbox in 2.0.0-beta.2 - UserCollection::load is not in the sandbox allowlist - see the separate GHSA-58hj-46fw-rcfm advisory.
Files:
system/src/Grav/Common/Security.php- newSecurity::getNonceKey()+ migration.system/src/Grav/Common/Utils.php-generateNonceStringnow uses the new key.system/src/Grav/Common/Service/SessionServiceProvider.php.system/src/Grav/Common/Config/Setup.php- removed auto-gen ofsecurity.salt.system/config/security.yaml- removed placeholdersalt:.tests/unit/Grav/Common/Security/NonceKeySecurityTest.php- migration + generation coverage.
AnalysisAI
Sensitive information disclosure in Grav CMS v1.8.0-beta.29 allows low-privileged users with page editing permissions to bypass Twig sandbox restrictions and extract administrative password hashes and security salts via the exposed grav['accounts'] service. A content editor can inject a Twig template with {{ grav['accounts'].load('admin').get('hashed_password') }} to retrieve plaintext Bcrypt hashes accessible for offline brute-force attack. Vendor-released patch available (2.0.0-beta.2 and commit c66dfeb5ff679a1667678c6335eb9ff3255dfc47); publicly available proof-of-concept exists demonstrating practical exploitation.
Technical ContextAI
The vulnerability stems from inadequate Twig sandbox isolation in Grav's template processing engine. Despite prior security patches in v1.8.0-beta.27/28 that added a isDangerousFunction filter to restrict access to sensitive objects, the grav['accounts'] service remained accessible from within Twig templates with process: twig: true enabled. The Accounts Service exposes a load() method allowing retrieval of user objects, and the grav.config object exposes the security.salt parameter used for CSRF nonce generation and session handling. The root cause is CWE-863 (Incorrect Authorization), compounded by inadequate whitelisting in the Twig sandbox implementation. The fix in Grav 2.0.0-beta.2 migrates the HMAC key from the web-accessible security.yaml Config tree into a security-private.php file blocked by .htaccess, and adds the UserCollection::load method to the Twig function blocklist. CPE identifies the affected package as pkg:composer/getgrav/grav versions below 2.0.0-beta.2.
RemediationAI
Vendor-released patch: upgrade to Grav 2.0.0-beta.2 or apply commit c66dfeb5ff679a1667678c6335eb9ff3255dfc47 directly (https://github.com/getgrav/grav/commit/c66dfeb5ff679a1667678c6335eb9ff3255dfc47). The fix relocates the HMAC key from user/config/security.yaml to user/config/security-private.php (protected by .htaccess), removes the salt from the Config object, and blocks UserCollection::load from the Twig function allowlist. For 1.8.x beta users unable to upgrade immediately, apply compensating controls: disable Twig processing on all user-editable pages by setting process: twig: false in page frontmatter or via site-wide config (system.pages.process: [markdown] only, excluding twig), restrict page editing permissions to trusted administrators only, or implement a Web Application Firewall rule blocking Twig syntax (e.g., {{ and }}) from page content submissions. Note that disabling Twig globally may break legitimate template features; coordinate with content editors. No partial patch is available for 1.8.x - remediation requires either full upgrade or policy-level access control.
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
NetAlertX (formerly PiAlert) versions 23.01.14 through 24.x before 24.10.12 allow unauthenticated command injection thro
The GiveWP - Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to PHP Object Injection in all
Same weakness CWE-863 – Incorrect Authorization
View allSame technique Authentication Bypass
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-3f29-pqwf-v4j4