{"id":"CVE-2026-42610","aliases":["CVE-2026-42610","GHSA-3f29-pqwf-v4j4"],"related":[],"kind":"vulnerability","state":"published","title":"Grav: Sensitive Information Disclosure via Accounts Service Bypass","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\nInformation 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.\n\nA 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.\n\n## Affected version\nGrav CMS: `v1.8.0-beta.29` (and earlier 1.8.x beta versions).\n\nNote: This vulnerability persists even after the vendor attempted to mitigate similar SSTI vectors in earlier beta releases.\n\n## Steps to Reproduce\n1. 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.\n\n2. Login to the Admin panel using  `editor_chen`. Navigate to Pages and edit the `Home` page.\n\n\n3. Under the Advanced tab, ensure Process Twig is enabled .\n\n4. In the Content tab, inject the following Twig payload designed to bypass the `isDangerousFunction` filter by accessing the internal service container:\n```\n---\ntitle: Information Disclosure Test\nprocess:\n    twig: true\n---\n# Security Audit Results\n- Admin Password Hash: {{ grav['accounts'].load('admin').get('hashed_password') }}\n- Security Salt: {{ grav.config.get('security.salt') }}\n```\n<img width=\"1176\" height=\"618\" alt=\"GRAV\" src=\"https://github.com/user-attachments/assets/7970216a-2dc6-4d1b-8dfd-b64f3712c9c5\" />\n\n\n5. 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.\n<img width=\"1278\" height=\"462\" alt=\"GRAV2\" src=\"https://github.com/user-attachments/assets/33b7b894-6ae3-4d29-bd2d-8004e9b343e0\" />\n\n\n\n\n\n\n\n## PoC\n```\n---\ntitle: Information Disclosure Test\nprocess:\n    twig: true\n---\n# Security Audit Results\n- Admin Password Hash: {{ grav['accounts'].load('admin').get('hashed_password') }}\n- Security Salt: {{ grav.config.get('security.salt') }}\n```\n\n## Impact\nAttackers can obtain the password hashes of all registered users, including Super Administrators.\n\nExtracted hashes can be subjected to offline brute-force or dictionary attacks (EX: USE Hashcat)\n\n## Video\nPls refer to the attached video\n<video src=\"https://github.com/user-attachments/assets/74d5ae41-7911-4099-b2cc-e6c51b27c68c\" controls=\"controls\" style=\"max-width: 100%;\">\n</video>\n\n\n\n---\n\n## Maintainer note — fix applied (2026-04-24)\n\nFixed in Grav core on the `2.0` branch: commit [`d904efc33`](https://github.com/getgrav/grav/commit/d904efc33) — will ship in **2.0.0-beta.2**.\n\n**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.\n\nThe 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.\n\n**Files:**\n- [`system/src/Grav/Common/Security.php`](https://github.com/getgrav/grav/blob/2.0/system/src/Grav/Common/Security.php) — new `Security::getNonceKey()` + migration.\n- [`system/src/Grav/Common/Utils.php`](https://github.com/getgrav/grav/blob/2.0/system/src/Grav/Common/Utils.php) — `generateNonceString` now uses the new key.\n- [`system/src/Grav/Common/Service/SessionServiceProvider.php`](https://github.com/getgrav/grav/blob/2.0/system/src/Grav/Common/Service/SessionServiceProvider.php).\n- [`system/src/Grav/Common/Config/Setup.php`](https://github.com/getgrav/grav/blob/2.0/system/src/Grav/Common/Config/Setup.php) — removed auto-gen of `security.salt`.\n- [`system/config/security.yaml`](https://github.com/getgrav/grav/blob/2.0/system/config/security.yaml) — removed placeholder `salt:`.\n- [`tests/unit/Grav/Common/Security/NonceKeySecurityTest.php`](https://github.com/getgrav/grav/blob/2.0/tests/unit/Grav/Common/Security/NonceKeySecurityTest.php) — migration + generation coverage.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-05-05T21:26:45.000Z","modified":"2026-10-26T18:10:00.173Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-863"],"affected":[{"ranges":[{"version":"< 2.0.0-beta.2","status":"affected"}],"vendor":"getgrav","product":"grav","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.0.0-beta.2"}],"ecosystem":"Packagist","package":"getgrav/grav","purl":"pkg:composer/getgrav/grav","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"1.8.0"},{"status":"affected","version":"2.0.0"}],"vendor":"getgrav","product":"grav","cpe":"cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-3f29-pqwf-v4j4","tags":["exploit","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/getgrav/grav/commit/c66dfeb5ff679a1667678c6335eb9ff3255dfc47","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42610","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/getgrav/grav","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-11T15:49:51.347Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42610","url":"https://www.cve.org/CVERecord?id=CVE-2026-42610","licence":"CVE Terms of Use","modified":"2026-05-11T15:50:03.339Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3f29-pqwf-v4j4","url":"https://github.com/advisories/GHSA-3f29-pqwf-v4j4","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:04.417Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42610","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42610","licence":"Public domain","modified":"2026-10-26T18:10:00.173Z"}],"updatedAt":"2026-11-25T22:59:21.198Z","epss":{"score":0.0029,"percentile":0.23163,"date":"2026-12-01T12:00:22.000Z"}}