GHSA-4QVF-3FR5-MPQ8
Publishers and read-only user managers can read account password hashes, 2FA secrets and reset tokens
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-4QVF-3FR5-MPQ8 divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Grav hides account password hashes, 2FA secrets and pending reset tokens when it serializes an account to JSON, but several other ways of reading an account object still return them. A page editor (publisher) can put a Flex form on a page that prints the super admin's password hash and 2FA secret. An account that only holds `api.access` and `admin.users.read` can read other accounts' pending password reset tokens through the Flex API. Either is enough to take over the super admin account, the second whenever outgoing mail is configured. This is a gap left by the fix for GHSA-gq3g-666w-7h85, which filtered only `jsonSerialize()`.
Affected versions
Grav 2.x from 2.0.0 up to and including 2.2.17. The form path dates from Grav 1.6.0. Grav 1.7 has no `jsonSerialize()` filter at all, but the publisher and admin-grant routes are not eligible for a 1.7 release, and the reset token route depends on the Grav 2 API plugin.
Details
The Flex user object has no `getFormValue()` override, so a Flex form bound to an account takes its field values from the unfiltered object. `UserObject::jsonSerialize()` and `DataUser\User::jsonSerialize()` remove only `hashed_password`, `secret` and `twofa_secret`, so the pending `reset` token and the `email_change_cancel_token` stay in the output. `DataUser\User` also has no `toArray()` override, so the toolbox export returns the raw items. The Login plugin's profile template calls `form.setAllData(grav.user.toArray)`, and its `2fa_secret` field template reads `twofa_secret` straight from `form.object` and prints it whatever the form value is.
Two routes were confirmed. First, a publisher builds a page with a Flex form for the `user-accounts` directory and the super admin's bcrypt hash appears in the form. The reproducer shows this both for an account with `admin.users.read` and anonymously, because the Flex Objects plugin's `authorizePage()` returns early when the last Flex form on a page names a directory it does not know, which skips the access check. Second, the API plugin stores the plain `reset` token when a reset is requested (after the `plugins.email.from` check), and the Flex API returns the object's `jsonSerialize()` output, so `admin.users.read` yields the token and with it the super admin account. The second route was checked against the code but not run.
Impact
A publisher, or an account with only read access to the user directory, can read other accounts' password hashes, 2FA secrets and reset tokens. That is enough to take over the super admin account. The first route needs page edit rights and no mail, the second needs a granted `admin.users.read` and working outgoing mail.
Patches
Fixed in Grav 2.2.18. Core now strips a single list of secret fields (`hashed_password`, `secret`, `twofa_secret`, `reset` and `email_change_cancel_token`) from both `jsonSerialize()` implementations and from the values a Flex form reads, and `DataUser\User::toArray()` returns the filtered output. Update the Flex Objects plugin to 1.4.18 as well: `authorizePage()` now checks every Flex form on a page and denies a form whose directory is unknown or missing. Update the Login plugin to 3.11.2 too: the `2fa_secret` field renders the secret and its QR code only when the form's object is the account of the member viewing it.
Credits
Discovered by Anthropic's OSS Scanner (ANT-2026-BSAT03KM).
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistgetgrav/grav |
Corregida | 2.2.18 | — | — |
2.2.18Arsenal 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-4qvf-3fr5-mpq8Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
