GHSA-PC8M-JXVH-VMRC
Low-privileged user can change super-admin password through Flex Objects
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-PC8M-JXVH-VMRC divulgada | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
I found a permission bypass in the Flex Objects API. A low-privileged user can use the generic Flex endpoint to change a super administrator's password or give their own group super-admin access. The normal Users and Groups API endpoints correctly block the same changes.
Tested versions
- Grav 2.0.11 - commit `ad9709f865b09b68798fb1ac375b484a8cc1d892`
- Flex Objects 1.4.6 - commit `0b384f5b0e73b1ad9dd29c70185407895ea3b09f`
- API 1.0.11 - commit `8071c10bc3a4743a4b8cf003dfb1644d6680c2ea`
- Admin2 2.0.14 - commit `a0bf26f7e5d7a98894b7cd2b8c5afe419b264e53`
## Access needed
The attacker needs a Grav account with:
access:
api:
access: true
admin:
login: true
users:
update: trueThe account does not have `api.users.write`, `api.super`, or `admin.super`.
Steps to reproduce
- Create a super administrator called `auditadmin` and a low-privileged account called `flexauditlow` with the permissions above.
- Log in as `flexauditlow` through `POST /api/v1/auth/token` and copy its bearer token.
- Send the normal Users API request below. It is correctly rejected with HTTP 403, and the password does not change.
PATCH /api/v1/users/auditadmin HTTP/1.1
Authorization: Bearer <LOW_USER_TOKEN>
Content-Type: application/json
{"password":"Controlled-New-Password-2026!"}- Send the same change through the generic Flex endpoint:
PATCH /api/v1/flex-objects/user-accounts/auditadmin HTTP/1.1
Authorization: Bearer <LOW_USER_TOKEN>
Content-Type: application/json
{"password":"Controlled-New-Password-2026!"}- This request returns HTTP 200 and changes the super administrator's password.
- Log in as `auditadmin` with the new password. The response succeeds and contains `super_admin: true`.
I also reproduced a second path: the same low user could change a group through `/api/v1/flex-objects/user-groups/<group>` and add `admin.super: true`. The normal `/api/v1/groups/<group>` endpoint returned HTTP 403 for the same user and change.
Why this happens
`FlexApiController::update()` checks only the general Flex directory permission, then sends the full request body to the user or group object and saves it. It does not run the extra checks used by the dedicated Users and Groups controllers.
Relevant code:
- `grav-plugin-flex-objects/flex-objects.php:694-728`
- `grav-plugin-flex-objects/classes/Api/FlexApiController.php:346-387,808-859`
- Correct checks for comparison: `grav-plugin-api/classes/Api/Controllers/UsersController.php:919-1005`
- Correct group check: `grav-plugin-api/classes/Api/Controllers/GroupsController.php:160-201,310-323`
## Impact
A low-privileged account can take over an existing super administrator account or make itself a super administrator. This gives full control of the Grav site.
Suggested severity under Grav's policy: High.
CWE: CWE-863 (Incorrect Authorization).
CVSS 3.1: `AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H` — 8.8.
Suggested fix
Do not allow `user-accounts` and `user-groups` to use the generic Flex write routes. Send those requests to the dedicated Users and Groups controllers, or apply the same target, field, and super-admin checks before saving.
Versiones afectadas
2.0.11Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistgetgrav/grav |
Sin parche | — | — | — |
Arsenal 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-pc8m-jxvh-vmrcLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
