{"id":"CVE-2025-66470","aliases":["CVE-2025-66470","GHSA-2m4f-cg75-76w2","PYSEC-2026-1696"],"related":[],"kind":"vulnerability","state":"published","title":"NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized SVG content","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nA 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.\n\n### Details\nThe vulnerability is located in `nicegui/elements/interactive_image.js`.\nThe component uses the following code to render content:\n```javascript\n<g v-html=\"content\"></g>\n```\nVue'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.\n\n### PoC\n```python\nfrom nicegui import ui\n\n@ui.page('/')\ndef main():\n    ui.label('NiceGUI SVG XSS PoC')\n    \n    # Standard image loading\n    img = ui.interactive_image('[https://picsum.photos/640/360](https://picsum.photos/640/360)')\n    \n    # Payload: Embeds raw HTML execution inside SVG\n    # This executes immediately when the image component is rendered\n    img.content = (\n        '<foreignObject>'\n        '<body xmlns=\"[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)\">'\n        '<img src=x onerror=alert(\"XSS-SVG\")>'\n        '</body>'\n        '</foreignObject>'\n    )\n\nui.run()\n```\n\n### Impact\n- Type: Reflected / Stored XSS (depending on data source)\n\n- Severity: Moderate\n\n- 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2025-12-08T21:30:39.000Z","modified":"2026-10-07T20:10:01.970Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 3.4.0","status":"affected"}],"vendor":"zauberzeug","product":"nicegui","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.4.0"}],"ecosystem":"PyPI","package":"nicegui","purl":"pkg:pypi/nicegui","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.4.0"}],"vendor":"zauberzeug","product":"nicegui","cpe":"cpe:2.3:a:zauberzeug:nicegui:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.4.0"}],"ecosystem":"PyPI","package":"nicegui","purl":"pkg:pypi/nicegui","source":"pysec"}],"references":[{"url":"https://github.com/zauberzeug/nicegui/security/advisories/GHSA-2m4f-cg75-76w2","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/zauberzeug/nicegui/commit/58ad0b36e19922de16bbc79ea3ddd29851b1a3e3","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66470","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/zauberzeug/nicegui","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/nicegui","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-2m4f-cg75-76w2","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-12-09T14:17:55.053Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-66470","url":"https://www.cve.org/CVERecord?id=CVE-2025-66470","licence":"CVE Terms of Use","modified":"2025-12-09T16:03:45.875Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2m4f-cg75-76w2","url":"https://github.com/advisories/GHSA-2m4f-cg75-76w2","licence":"CC-BY-4.0","modified":"2026-07-07T17:56:37.836Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-66470","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66470","licence":"Public domain","modified":"2026-10-07T20:10:01.970Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1696","url":"https://osv.dev/vulnerability/PYSEC-2026-1696","licence":"CC-BY-4.0","modified":"2026-07-07T17:46:58.060Z"}],"updatedAt":"2026-11-25T22:59:08.457Z","epss":{"score":0.00272,"percentile":0.20965,"date":"2026-12-01T12:00:22.000Z"}}