GHSA-VXP9-82WW-28FG
Path traversal in the template name during page creation
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-VXP9-82WW-28FG 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 in the group of authenticated Panel users with 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 the content of a page in a text file inside the page's folder, and the name of that file is the name of the page's template, e.g. `content/notes/hello-world/article.txt` for a page with the `article` template.
The `template` prop reaches page creation from the REST API, from the Panel's page creation dialog, and from direct calls to `Page::create()` and `$page->createChild()` in site or plugin code. In affected releases it was not sanitized before it was used to build the path of the new page's content file.
`$page->changeTemplate()` is not affected.
Impact
In affected releases, a template name containing certain characters placed the content file of the new page outside the page's own folder.
Creating pages requires the `pages.create` permission. An attacker holding it could:
- destroy and replace the content of any page whose path they can guess or read from the Panel, including pages their role has no permission to update;
- create text files at arbitrary locations the web server process can write to.
The written file always carries 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, a template name is reduced to lowercase letters, digits, dots, hyphens and underscores before it is used.
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, do not pass untrusted input as the `template` prop to `Page::create()` or `$page->createChild()`.
Credits
Thanks to @manus-use 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-vxp9-82ww-28fgLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
