GHSA-GRG7-V3QM-GJMM
Cross-site scripting (XSS) from imported table and iframe HTML in the site frontend
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/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-GRG7-V3QM-GJMM divulgada · CVSS 8.5 (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 Kirby sites where a `blocks`/`layout` field is filled by pasting HTML from a source that may not be fully trusted. It requires an authenticated Panel user with update permission to such a field, or write access to content files through another vector, e.g. a frontend form.
The injected code executes in the site frontend only; the Panel does not render imported block content as HTML. Panel sessions are still at risk, as a script in the frontend can act against Kirby's API with the session of a logged in user browsing the site.
This vulnerability is of high severity for affected sites.
----
Affected components
Kirby's HTML importer for blocks converts arbitrary HTML into structured blocks. The Panel calls it from the paste route of the `blocks` field, which the `layout` field inherits, and Kirby calls it whenever a `blocks` field value is not valid JSON (including through the `$field->toBlocks()` method used in templates).
Two of the elements it recognizes were stored as raw source markup instead of being decomposed into block content: tables, and iframes whose `src` is not a known video URL.
Impact
In affected releases, the importer stored imported tables and non-video iframes as unsanitized HTML. Everything inside an imported `<table>` was kept as it came, including scripts and event handler attributes, and imported `<iframe>` elements kept every attribute.
The stored markup is emitted unchanged when the field is rendered, so the injected script runs in the browsers of site visitors and logged in users browsing the site. As the site usually runs on the same origin as the Panel API, this can give the attacker control of the victim's Panel session.
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, imported tables are sanitized against a strict allowlist before they are stored, and imported iframes that do not resolve to a known video URL are dropped.
Note that content imported before the patch may still contain malicious markup.
Workarounds
Until you can update:
- Remove the `markdown` block from the fieldsets of your `blocks` and `layout` fields, in the blueprint or globally with the `blocks.fieldsets` option. This covers pasting in the Panel.
- Do not paste or import HTML from sources you do not fully trust.
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-grg7-v3qm-gjmmLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
