CVE-2025-66470: NiceGUI Stored/Reflected XSS Vulnerability in ui.interactive_image Component

nicegui Updated 08 Dec 2025

Summary

08/12/2025
Yes i
Moderate
6.1

CVE-2025-66470: NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized SVG content. Affects nicegui versions < 3.4.0. Fixed in 3.4.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

NiceGUI is a Python framework that simplifies the creation of user interfaces for web applications. It allows developers to build interactive applications with ease, leveraging components like buttons, labels, and images. The ui.interactive_image component is designed to display images interactively, but it has a vulnerability that allows for Cross-Site Scripting (XSS) attacks due to unsanitized SVG content rendering.

Vulnerability Detail

A Cross-Site Scripting (XSS) vulnerability exists in the ui.interactive_image component of NiceGUI (v3.3.1 and earlier). This vulnerability arises from the use of Vue's v-html directive to render SVG content without proper sanitization. Attackers can exploit this flaw by injecting malicious HTML or JavaScript through the SVG <foreignObject> tag, which can execute scripts whenever the image component is rendered or updated. This poses a significant risk, especially in applications that display user-generated content or annotations.

How To Fix

Latest published version: 3.18.0 as of 22 Oct 2026

pip install --upgrade "nicegui==3.18.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.4.0

This is the first release that contains the fix.

pip install --upgrade "nicegui==3.4.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using user-controlled input for the content property of the interactive image component. Instead, use static or sanitized content to prevent the injection of malicious scripts. Here is an example of how to set a safe content property:

img.content = '<svg><circle cx="50" cy="50" r="40" fill="red" /></svg>'

Conclusion

The CVE-2025-66470 vulnerability in NiceGUI's ui.interactive_image component poses a significant risk due to its potential for XSS attacks. It is crucial to update to version 3.4.0 or later to mitigate this risk. Additionally, utilizing Vulert can help monitor and alert for such vulnerabilities in your applications.

See every vulnerability recorded for nicegui →

Share this vulnerability

FAQ

The vulnerability is a Cross-Site Scripting (XSS) issue that allows attackers to inject malicious scripts into the application via the ui.interactive_image component.

Versions of NiceGUI up to and including 3.3.1 are affected by this vulnerability.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can check your application against this vulnerability using the Vulert playground without any signup.

The CVSS score of this vulnerability is 6.1, indicating a moderate severity level.

If you cannot update the package right away, implement the suggested workaround by avoiding user-controlled input for the content property of the interactive image component.

Related vulnerabilities

Recent vulnerabilities recorded for nicegui.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 3.18.0 as of 22 Oct 2026

pip install --upgrade "nicegui==3.18.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.4.0

This is the first release that contains the fix.

pip install --upgrade "nicegui==3.4.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback