Skip to main content

NiceGUI CVE-2025-66470

MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2025-12-09 security-advisories@github.com
6.1
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft SVG foreignObject XSS payload
  2. Delivery
    Submit as image content/annotation
  3. Exploit
    App renders content via unsanitized v-html
  4. Execution
    Victim loads interactive_image component
  5. Persist
    Script executes in victim browser
  6. Impact
    Steal session data or act as user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires a NiceGUI application (v3.3.1 or earlier) that passes attacker-controllable or user-generated data into the content property of the ui.interactive_image component or one of its layers (add_layer content); that content is rendered as raw SVG through Vue's v-html directive with no sanitization, allowing an injected SVG <foreignObject> tag with embedded HTML/JavaScript. Limiting factors: the attack is client-side and requires a victim to render/view the affected component (UI:R), and it is only exploitable if the application actually surfaces untrusted content through this component - deployments that only display trusted/static SVG are not affected. The fix (3.4.0) makes sanitization explicit, so patched apps that still pass sanitize=False on untrusted input remain at risk by configuration.

Impact

This is a genuine but moderate-priority issue, and the signals are internally consistent rather than conflicting. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N, base 6.1) is the textbook reflected/stored XSS profile: network-reachable, low complexity, no attacker authentication (PR:N), but requiring victim interaction (UI:R) and yielding only partial confidentiality/integrity impact in the victim's browser context (scope change, S:C). EPSS is low at 0.25% (16th percentile), and the vulnerability is NOT listed in CISA KEV, so there is no evidence of active or widespread exploitation. The POC availability (publicly demonstrated in the GHSA advisory) raises the practical likelihood of opportunistic use but must not be conflated with active exploitation - these are distinct signals. The low EPSS is consistent with the absence of KEV and with the fact that exploitation is conditional (the host application must feed untrusted content into the component), not automatic against every deployment. Net: a legitimate client-side XSS worth patching, especially for multi-user dashboards displaying user-generated content, but not an emergency network-facing RCE. No key signals are missing except that KEV/active-exploitation status is simply 'not listed' rather than confirmed negative.

Exploit ScenarioDerived

In a NiceGUI dashboard that displays user-supplied annotations or image overlays through ui.interactive_image, an attacker submits an SVG payload containing a <foreignObject> tag with an embedded HTML element such as <img src=x onerror=alert(...)>. Because the component renders the content via Vue's v-html directive with no sanitization, the script executes in the browser of any user who views or refreshes the component. A public PoC exists in the GitHub Security Advisory (GHSA-2m4f-cg75-76w2), and exploitation only requires that the application pass attacker-influenced data into the component's content property and that a victim load the page (UI:R).

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 07, 2026

Stored or reflected cross-site scripting in NiceGUI 3.3.1 and earlier lets an attacker execute arbitrary HTML and JavaScript in a victim's browser through the ui.interactive_image component and its layers when application code passes attacker-influenced SVG content into the component's content property. The flaw requires user interaction (the victim must render the affected view), is reachable without authentication per the CVSS vector (AV:N/PR:N/UI:R), and is only exploitable in applications that surface untrusted or user-generated content through this component; deployments rendering only trusted, static SVG are not affected. Exploitation is practical rather than theoretical - publicly available exploit code exists in the form of a working GitHub advisory PoC using an SVG <foreignObject> payload - but the EPSS score is low at roughly 0.25% (16th percentile), and there is no evidence of confirmed active exploitation. A vendor patch is available: NiceGUI 3.4.0.

RemediationAI

Upgrade to NiceGUI 3.4.0, the vendor-released fixed version, as documented in advisory GHSA-2m4f-cg75-76w2 and applied by commit 58ad0b36e19922de16bbc79ea3ddd29851b1a3e3. The 3.4.0 upgrade alone is not the complete fix: it makes sanitization an explicit opt-in, so after upgrading you must pass a sanitize callback for any untrusted content - the vendor recommends Sanitizer().sanitize, which requires installing the html-sanitizer package - and reserve sanitize=False strictly for content you fully control and trust; applications that upgrade but keep passing sanitize=False on user-supplied SVG remain exploitable by configuration. Layers created via add_layer must likewise supply the sanitize argument, since they follow the same content path. If you cannot upgrade immediately, the primary compensating control is to stop feeding untrusted input to the content property of ui.interactive_image or to add_layer, sanitizing that input server-side with an allow-list HTML/SVG sanitizer before it reaches the component; as a defense-in-depth backstop, deploy a strict Content-Security-Policy (e.g. script-src without 'unsafe-inline') to blunt inline payload execution, accepting that CSP can break legitimate front-end functionality and is bypassable if other script sinks exist, and consider restricting the interactive views to authenticated, trusted users as an interim risk reduction (with the trade-off of reduced functionality for multi-user features).

Affected Packages

pypi nicegui fix: 3.4.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

NiceGUI is a Python UI framework that renders its front end with Vue/Quasar, mapping Python component objects to browser-side Vue templates. The ui.interactive_image element renders overlay content inside the SVG as raw markup via the Vue v-html directive (roughly '<g v-html="content"></g>'), which inserts a string directly into the DOM without escaping or sanitization. Because SVG permits the <foreignObject> element, injected markup can escape the SVG drawing context and instantiate arbitrary XHTML - for example a <body xmlns="http://www.w3.org/1999/xhtml"> containing an <img src=x onerror=...> - giving full HTML/JavaScript execution rather than being confined to harmless vector graphics. This is CWE-79 (Improper Neutralization of Input During Web Page Generation, i.e. cross-site scripting), and the CPE cpe:2.3:a:zauberzeug:nicegui:*:*:*:*:*:*:*:* covers all releases up to and including 3.3.1. The upstream fix reworks the component so sanitization is an explicit, caller-supplied decision: both the InteractiveImage constructor and add_layer accept a sanitize parameter typed as a callable, Literal[False], or None; the module imports a new helpers module for warn_once; and _handle_content_change emits a one-time warning when content is supplied while sanitize is None, directing developers to pass a sanitize function (the advisory recommends Sanitizer().sanitize from the html-sanitizer package) or explicitly opt out with sanitize=False for trusted content.

Know when Nicegui gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 6.1 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
vuln.today AI 6.1 MEDIUM

Network-delivered stored/reflected XSS, no attacker auth (PR:N) but victim must render the component (UI:R); scope change into the browser with limited confidentiality/integrity impact and no availability loss.

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.3%
Top 84% exploitable
Prevalence
Medium
popular open-source Python UI framework, common for internal dashboards/tools
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)CVE.org

cpe:2.3:a:zauberzeug:nicegui:*:*:*:*:*:*:*:*
CVE-2025-66645 HIGH POC
7.5 Dec 09

Remote arbitrary file read in NiceGUI versions 3.3.1 and below affects applications that explicitly call App.add_media_f

CVE-2026-25732 HIGH POC
7.5 Feb 06

Path traversal in NiceGUI before 3.7.0 allows remote attackers to write arbitrary files outside intended directories by

CVE-2026-21873 HIGH POC
7.2 Jan 08

NiceGUI versions 2.22.0 through 3.4.1 contain a cross-site DOM-based XSS vulnerability in the pushstate event listener f

CVE-2026-21872 MEDIUM POC
6.1 Jan 08

NiceGUI versions 2.22.0 through 3.4.1 contain a stored cross-site scripting vulnerability in the click event listener of

CVE-2026-21871 MEDIUM POC
6.1 Jan 08

Cross-site scripting (XSS) in NiceGUI versions 2.13.0 through 3.4.1 allows attackers to execute arbitrary JavaScript in

CVE-2026-25516 MEDIUM POC
6.1 Feb 06

Cross-site scripting in NiceGUI's ui.markdown() component allows unauthenticated attackers to inject malicious HTML and

CVE-2025-66469 MEDIUM POC
6.1 Dec 09

Reflected cross-site scripting in NiceGUI 3.3.1 and earlier lets remote unauthenticated attackers inject arbitrary JavaS

CVE-2026-21874 MEDIUM POC
5.3 Jan 08

NiceGUI versions 2.10.0 through 3.4.1 fail to properly release Redis connections when users open and close browser tabs,

CVE-2026-27156 MEDIUM
6.1 Feb 24

NiceGUI versions prior to 3.8.0 are vulnerable to stored cross-site scripting (XSS) through multiple APIs that improperl

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy