GHSA-679V-CH4Q-94QM
Accounts with list access can delete Flex objects and take over the site
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-679V-CH4Q-94QM divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Sorting a Flex collection by the field name `delete` deletes the objects being sorted. An account that may only list user accounts (`api.access` plus `admin.users.list`) can delete every user account, super admins included, with two `GET /api/v1/flex-objects/user-accounts?sort=delete` requests. Once `user/accounts` is empty, the API plugin's first-run setup accepts an unauthenticated request and creates a new super admin. The same field resolution is reachable from page content through the Flex Objects shortcode.
Affected versions
Grav 2.x from 2.0.0 up to and including 2.2.17. The bare-name accessor was introduced in Grav 1.5.0-beta.2 and is present in Grav 1.7. The demonstrated takeover chain runs on Grav 2 with the API plugin, and no qualifying 1.7 reproduction was established, so no 1.7 release is part of this advisory.
Details
`ObjectExpressionVisitor::getObjectFieldValue()` resolves a sort or filter field by trying the accessor prefixes `''`, `get` and `is`. A field that is not a property is therefore first called as a public method under its own bare name. `FlexObject::delete()` checks no permission, so the user object's own refusal to let non-super users delete super accounts is never consulted. The request ends in a 500 after the first comparison, by which point both compared objects are already deleted, and the endpoint's `filters[key][]` parameter lets the caller choose which two are removed. The Flex Objects API accepts the sort field after only a `list` check on the directory. All comparison operators in the visitor use the same resolver, including wrapped fields such as `lower(delete)`.
The reproducer on the demo site shows the list-only account refused by both delete endpoints with 403, then removing all four account files with the two sorted listings, after which setup without credentials returns 200 with `super_admin = True`. The Flex Objects shortcode also passes content-authored `sort=` values into the resolver. A publisher with no Flex permission can delete two objects per page view from any Flex directory shown on the site, and user accounts are only deleted that way when a super admin who is logged in on the front end views the page.
Impact
An account granted only list access on a Flex directory can delete data outside that grant. Against the accounts directory this removes every account, and the reopened first-run setup then gives the attacker a super-admin account. Every path needs a login, and the list-only account has to be granted by a super admin. Without the final setup step the outcome is still the loss of every account.
Patches
Fixed in Grav 2.2.18. Sort and filter fields are resolved as properties first and then through `get*` and `is*` getters, so a field name is never called as a method of its own. Page fields that only exist as read-only methods (such as `route`, `url`, `rawRoute`, `path`, `modified`, `id`, `home`, `root`, `active`, `activeChild`, `permalink` and `filePath`) are mapped explicitly so sorting and filtering by them keeps working. The shortcode route is closed by the same change in core.
Credits
Discovered by Anthropic's OSS Scanner (ANT-2026-PJPOY9MC).
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-679v-ch4q-94qmLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
