GHSA-G7P7-X2M4-2H6P
Page creation API writes content to an arbitrary path via unfiltered `root` and `dirname` parameters
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-G7P7-X2M4-2H6P divulgada · CVSS 7.1 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
TL;DR
This vulnerability affects all Kirby sites that might have potential attackers among the authenticated Panel users holding the `pages.create` permission. It also affects sites and plugins that pass untrusted input into `Page::create()` or `$page->createChild()`.
Sites whose Panel users are all trusted and that don't create pages from untrusted input are *not* affected.
This vulnerability is of high severity for affected sites.
----
Affected components
Kirby stores each page in its own folder below the content directory, with drafts in the parent's `_drafts` folder. That location is derived from the content root, the parent page and the page's directory name.
Two props on the page object override that derivation: `root` replaces the computed path entirely, `dirname` replaces the page's own directory name. In affected releases neither was filtered out of the props passed to page creation, so both reached the page object from the REST API, from `Page::create()` or `$page->createChild()` in site or plugin code.
The Panel's page creation dialog is not an entry point.
Impact
In affected releases, a page creation request could carry its own storage location, so the caller decided where the new page's content file was written: onto an existing page, or at any path on disk, inside or outside the Kirby installation.
Creating pages requires the `pages.create` permission. An attacker holding it could:
- replace the content of existing pages, including pages their role has no permission to update
- create directories and text files at arbitrary locations on the server.
The written file carries the page's template name and the configured content extension (`.txt` by default), so this does not allow placing executable code on the server. The target path is only ever written to, never read.
Patches
The problem has been patched in Kirby 5.6.0 https://github.com/getkirby/kirby/releases/tag/5.6.0 and Kirby 4.9.6 https://github.com/getkirby/kirby/releases/tag/4.9.6.
In these releases, `PageActions::normalizeProps()` removes the `root` and `dirname` props before the page object is built, so both are always derived from the parent page and the slug.
Workarounds
Until you can update:
- Remove the `pages.create` permission from any role whose users you do not fully trust.
- In site and plugin code, unset `root` and `dirname` from any props array built from untrusted input before passing it to `Page::create()` or `$page->createChild()`.
Credits
Thanks to Bruno Meilick (@bnomei) for responsibly reporting the identified issue.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistgetkirby/cms |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/getkirby/kirby/security/advisories/GHSA-g7p7-x2m4-2h6pLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
