GHSA-CQ58-R77C-5JJW
Cross-site scripting (XSS) from image block content in the site frontend
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-CQ58-R77C-5JJW divulgada | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice |
Impact
Kirby's blocks field https://getkirby.com/docs/reference/panel/fields/blocks stores structured data for each block. This data is then used in block snippets https://getkirby.com/docs/reference/panel/fields/blocks#block-snippets to convert the blocks to HTML for use in your templates. We recommend to escape HTML special characters https://getkirby.com/docs/guide/templates/escaping against cross-site scripting (XSS) attacks.
Cross-site scripting (XSS) is a type of vulnerability that allows to execute any kind of JavaScript code inside the site frontend or Panel session of other users. If the user is logged in to the Panel, a harmful script can for example trigger requests to Kirby's API with the permissions of the victim.
The default snippet for the image block https://getkirby.com/docs/reference/panel/blocks/image unfortunately did not use our escaping helper. This made it possible to include malicious HTML code in the source, alt and link fields of the image block, which would then be displayed on the site frontend and executed in the browsers of site visitors and logged in users who are browsing the site.
This vulnerability is critical if you might have potential attackers in your group of authenticated Panel users. They can escalate their privileges if they get access to the Panel session of an admin user. Depending on your site, other JavaScript-powered attacks are possible.
You are *not* affected if you don't use the blocks field or specifically the image block in any of your blueprints. You are also protected if you use a custom block snippet https://getkirby.com/docs/reference/panel/fields/blocks#block-snippets that either escapes the printed values or doesn't use them. The attack can only be performed by logged-in users and only surfaces in the site frontend (i.e. in your templates). The Panel itself is unaffected and will not execute JavaScript that was injected into the image block content.
Patches
We have patched the vulnerability in Kirby 3.5.8 https://github.com/getkirby/kirby/releases/tag/3.5.8 by escaping special HTML characters in the output from the default image block snippet. Please update to this or a later version https://github.com/getkirby/kirby/releases/ to fix the vulnerability.
Credits
Thanks to Azrul Ikhwan Zulkifli (@azrultech) from BAE Systems AI Vulnerability Research Team for responsibly reporting the identified issue.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistgetkirby/cms |
Corregida | 3.5.8 | — | — |
3.5.8Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://nvd.nist.gov/vuln/detail/CVE-2021-41258https://github.com/getkirby/kirby/security/advisories/GHSA-cq58-r77c-5jjwhttps://github.com/getkirby/kirby/pull/3510https://github.com/getkirby/kirbyhttps://github.com/getkirby/kirby/releases/tag/3.5.8Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
