GHSA-29F4-MJFQ-7GPH
Path traversal during user creation allows writing account files outside the accounts directory
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-29F4-MJFQ-7GPH divulgada · CVSS 7 (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 with untrusted Panel user who are allowed to create users as well as by sites or plugins that pass untrusted input into `User::create()`.
Sites that restrict user creation to trusted users are *not* affected.
This vulnerability is of high severity for affected sites.
----
Affected components
Each Kirby user is stored in a subdirectory of `site/accounts` that is named after the user's ID. Creating a user writes the account's `index.php` and `.htpasswd` file into that directory.
The ID is supplied by the caller, through the REST endpoint and through `User::create()` in site or plugin code. In affected releases it was not validated for safe characters and was used verbatim to build the account directory path.
Impact
By creating a user with a crafted ID, an attacker could make Kirby write the account files into any directory the web server process can write to, inside or outside the Kirby installation. The file names are fixed; their directory is determined by the supplied ID.
An attacker could therefore:
- overwrite an existing `index.php`, e.g. the site's front controller, and take the whole site down;
- overwrite the files of an existing account, including its password file, and take that account over;
- create stray account files and directories in unexpected locations on the server.
The account files hold escaped user data, so this does not allow placing executable code on the server.
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, Kirby validates the user ID during user creation and rejects any ID that contains characters other than letters, digits, underscores and dashes, so the resulting account path always stays within `site/accounts`.
Workarounds
Until you can update:
- Remove the `users.create` permission from any role whose users you do not fully trust.
- In site and plugin code, do not pass untrusted input as the `id` prop to `User::create()`.
Credits
Thanks to Bruno Meilick (@bnomei), @manus-use and @smitverma 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-29f4-mjfq-7gphLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
