NiceGUI
CVE-2025-66470
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft SVG foreignObject XSS payload
-
DeliverySubmit as image content/annotation
-
ExploitApp renders content via unsanitized v-html
-
ExecutionVictim loads interactive_image component
-
PersistScript executes in victim browser
-
ImpactSteal 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 |
| 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). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
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.
Primary rating from Vendor (github).
CVSS VectorVendor: github
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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
Remote arbitrary file read in NiceGUI versions 3.3.1 and below affects applications that explicitly call App.add_media_f
Path traversal in NiceGUI before 3.7.0 allows remote attackers to write arbitrary files outside intended directories by
NiceGUI versions 2.22.0 through 3.4.1 contain a cross-site DOM-based XSS vulnerability in the pushstate event listener f
NiceGUI versions 2.22.0 through 3.4.1 contain a stored cross-site scripting vulnerability in the click event listener of
Cross-site scripting (XSS) in NiceGUI versions 2.13.0 through 3.4.1 allows attackers to execute arbitrary JavaScript in
Cross-site scripting in NiceGUI's ui.markdown() component allows unauthenticated attackers to inject malicious HTML and
Reflected cross-site scripting in NiceGUI 3.3.1 and earlier lets remote unauthenticated attackers inject arbitrary JavaS
NiceGUI versions 2.10.0 through 3.4.1 fail to properly release Redis connections when users open and close browser tabs,
NiceGUI versions prior to 3.8.0 are vulnerable to stored cross-site scripting (XSS) through multiple APIs that improperl
NVD
CVE.org
EPSS
GitHub
Exploit-DB