6.1medium
NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized SVG content
- Severity
- 6.1medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.27% (higher than 20% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-2m4f-cg75-76w2PYSEC-2026-1696
Description
NiceGUI is a Python-based UI framework. Versions 3.3.1 and below are subject to a XSS vulnerability through the ui.interactive_image component of NiceGUI. The component renders SVG content using Vue's v-html directive without any sanitization. This allows attackers to inject malicious HTML or JavaScript via the SVG <foreignObject> tag whenever the image component is rendered or updated. This is particularly dangerous for dashboards or multi-user applications displaying user-generated content or annotations. This issue is fixed in version 3.4.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| zauberzeug nicegui | < 3.4.0, before 3.4.0 | CVE List, NVD |
| nicegui (PyPI) | before 3.4.0 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| PyPA Advisory Database | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
NiceGUI is a Python-based UI framework. Versions 3.3.1 and below are subject to a XSS vulnerability through the ui.interactive_image component of NiceGUI. The component renders SVG content using Vue's v-html directive without any sanitization. This allows attackers to inject malicious HTML or JavaScript via the SVG <foreignObject> tag whenever the image component is rendered or updated. This is particularly dangerous for dashboards or multi-user applications displaying user-generated content or annotations. This issue is fixed in version 3.4.0.
GitHub Advisory Database
Summary
A Cross-Site Scripting (XSS) vulnerability exists in the ui.interactive_image component of NiceGUI (v3.3.1 and earlier). The component renders SVG content using Vue's v-html directive without any sanitization. This allows attackers to inject malicious HTML or JavaScript via the SVG <foreignObject> tag.
Details
The vulnerability is located in nicegui/elements/interactive_image.js.
The component uses the following code to render content:
<g v-html="content"></g>
Vue's v-html directive renders raw HTML strings into the DOM. If an application allows user-controlled input to be passed to the content property of an interactive image, an attacker can embed a <foreignObject> tag containing malicious scripts, bypassing typical image restrictions.
PoC
from nicegui import ui
@ui.page('/')
def main():
ui.label('NiceGUI SVG XSS PoC')
# Standard image loading
img = ui.interactive_image('[https://picsum.photos/640/360](https://picsum.photos/640/360)')
# Payload: Embeds raw HTML execution inside SVG
# This executes immediately when the image component is rendered
img.content = (
'<foreignObject>'
'<body xmlns="[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)">'
'<img src=x onerror=alert("XSS-SVG")>'
'</body>'
'</foreignObject>'
)
ui.run()
Impact
-
Type: Reflected / Stored XSS (depending on data source)
-
Severity: Moderate
-
Impact: Attackers can inject malicious scripts that execute whenever the image component is rendered or updated. This is particularly dangerous for dashboards or multi-user applications displaying user-generated content or annotations.
NVD (es)
NiceGUI es un framework de UI basado en Python. Las versiones 3.3.1 e inferiores están sujetas a una vulnerabilidad XSS a través del componente ui.interactive_image de NiceGUI. El componente renderiza contenido SVG utilizando la directiva v-html de Vue sin ninguna sanitización. Esto permite a los atacantes inyectar HTML o JavaScript malicioso a través de la etiqueta SVG <foreignObject> cada vez que el componente de imagen es renderizado o actualizado. Esto es particularmente peligroso para dashboards o aplicaciones multiusuario que muestran contenido generado por el usuario o anotaciones. Este problema está solucionado en la versión 3.4.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-66470 changed 2025-12-09 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2m4f-cg75-76w2 changed 2026-07-07 | CC-BY-4.0 |
| NVD | CVE-2025-66470 changed 2026-10-07 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1696 changed 2026-07-07 | CC-BY-4.0 |