GHSA-QGMC-P8W7-7X5P
Grav 1.7: a user manager without super-admin access can take over a super-admin account from the classic admin Accounts page
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-QGMC-P8W7-7X5P divulgada · CVSS 7.2 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
On Grav 1.7, an account with the classic admin's user-management permission (`admin.users`) but without super-admin access can take over a super-admin account from the Accounts page. The page is served by Flex Objects in the default `grav-admin` bundle, and Flex user saves did not check whether the target account is a super admin. The manager can set a new password for the super admin (through the normal password field), write a password hash of their choosing into the account (`hashed_password` is not declared in the account blueprint and passes its loose validation), or delete the account. The edit form also hands the manager the super admin's password hash and any pending password-reset token as hidden fields.
The classic admin's own user form already refuses this (fixed for earlier reports), but that code path is not used when Flex Objects manages accounts, which is the default.
Affected versions
- Grav core 1.7.0 through 1.7.53.10, with the classic Admin plugin and Flex Objects (the default `grav-admin` package; Flex Objects manages accounts by default). Reproduced on Grav 1.7.53.10, Admin 1.10.60, Flex Objects 1.3.8, Login 3.12.1.
- Grav 2.x is not affected through this route: the classic admin does not run on 2.x, and the Admin2 / API user endpoints only copy known fields and refuse non-super managers on super-admin accounts. The same core guard and the hash filtering for Flex user saves shipped in Grav 2.2.13.
The original report gave the affected range as Grav 2.0.1 to 2.2.9. Those releases are fixed in 2.2.13 for the narrower 2.x path; the PoC's route (`/admin/accounts/users/<username>`, `task=save`) belongs to the classic admin and is live on the 1.7 line.
Details
- `UserObject::isAuthorizedOverride()` (`system/src/Grav/Common/Flex/Types/Users/UserObject.php`) let any account holding the user-management rule create, update or delete any other account, including super admins. Flex Objects' admin controller authorizes saves and deletes through it.
- `FlexObject::update()` writes every key that survives `BlueprintSchema::filter()`. The account blueprint uses `validation: loose` and does not declare `hashed_password`, so a submitted hash was stored. `UserObject::save()` only replaces the hash when `password` is submitted, so omitting it keeps the injected value.
- The classic admin's form template carries every undeclared account key back as a hidden `data[_json][...]` field, which put the target's `hashed_password` and `reset` token in the page served to the manager. With email configured, a manager can request a reset for the super admin through the public forgot-password form and read the token from the edit page.
The reporter's PoC, run against the Accounts page as a non-super `admin.users` manager:
curl -sk "https://<site>/admin/accounts/users/<super_admin>" -b "<manager_session>" \
--data-urlencode "__form-name__=flex-user_accounts" \
--data-urlencode "__unique_form_id__=<id>" --data-urlencode "form-nonce=<nonce>" \
--data-urlencode "task=save" \
--data-urlencode 'data[hashed_password]=<bcrypt hash of a known password>'The same request with `data[password]=<new password>` instead also succeeds, and the edit page's `task:delete` link deletes the account.
Impact
A user manager without super-admin access can sign in as a super admin and gain full control of the site. Grav treats user management as stopping short of the super-admin tier, so this crosses a trust boundary. Severity is rated High: it needs an authenticated admin account with `admin.users`.
Patches
Fixed in Grav 1.7.53.11. Flex user saves and deletes now refuse a super-admin target unless the acting account is a super admin itself (own access or through a group), submitted `hashed_password` and session flags are ignored on update, and account credentials and one-time tokens are left out of the extra data that forms carry as hidden fields.
Workaround until upgrading: grant `admin.users` only to accounts you would trust with super-admin access.
Credits
Reported by @manus-pi.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistgetgrav/grav |
Corregida | 1.7.53.11 | — | — |
1.7.53.11Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/getgrav/grav/security/advisories/GHSA-qgmc-p8w7-7x5pLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
