GHSA-95JR-Q4XH-27VR
Page author can delete protected pages through a Flex form opened by a page editor
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-95JR-Q4XH-27VR divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
A user who can only write pages could store a page containing a Flex form whose field directives call methods on the form's Flex object. When a signed-in user with page edit rights opened that page, the directives ran in that user's session and could delete a page that neither account was allowed to delete.
Affected versions
Grav 2.0.0 through 2.2.4. The same code exists in Grav 1.7, where the fix is not backported: exploitation needs an account that can author pages, which is outside the 1.7 backport policy.
Details
`FlexDirectory::dynamicFlexField()` handles `flex-*@` directives in a form blueprint by calling the named method on the Flex object. The only check was that the method exists. The neighbouring `data-*@` handler already limits what a directive from page frontmatter may call, but this handler did not, and it ignored the flag that says whether a directive came from a blueprint file or from page content.
A form defined in page frontmatter could therefore call any public method of the object with arguments of the author's choice. The form is authorized against the object it names. A first directive calling `setStorageKey()` points that already-authorized object at a different page, and a second directive calling `delete()` then removes it. Neither method checks permissions itself.
The directives run only when the viewer is allowed to edit the object the form names, so the page author cannot trigger them and an anonymous visitor cannot either. They run in the session of the more privileged user who opens the page.
The original report describes the Pages API accepting a `form` block from a non-super author as part of the same issue. That is a separate question in the API and Flex Objects plugins. The defect fixed here is in core and does not depend on it.
Impact
A page author can cause pages to be deleted that the author, and the user who opens the page, are both denied from deleting. Other public methods of the page object could be called the same way. No code execution, file access outside page storage, or disclosure was shown.
Patches
Fixed in Grav 2.2.5. A `flex-*@` directive written in page frontmatter can now only check whether the object exists. Directives in blueprint files are unchanged.
Credits
Reported by @ffasterss and @shirabe0x05 of Omoikane Labs.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistgetgrav/grav |
Corregida | 2.2.5 | — | — |
2.2.5Arsenal 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-95jr-q4xh-27vrLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
