CVE-2025-53354 NiceGUI is vulnerable to Reflected XSS attack
Attackers can execute arbitrary JavaScript in users' browsers via unescaped input in NiceGUI applications using ui.html().
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2025-53354?
CVE-2025-53354 is a medium-severity cross-site scripting vulnerability in zauberzeug nicegui, published on 3 Oct 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
NiceGUI is a Python-based UI framework. Versions 2.24.2 and below are at risk for Cross-Site Scripting (XSS) when developers render unescaped user input into the DOM using ui.html(). NiceGUI did not enforce HTML or JavaScript sanitization, so applications that directly combine components like ui.input() with ui.html() or ui.chat_message with HTML content without escaping may allow attackers to execute arbitrary JavaScript in the user’s browser. Applications that do not pass untrusted input into ui.html() are not affected. This issue is fixed in version 3.0.0.
Weakness: CWE-79
Which versions are affected by CVE-2025-53354?
3 open source packages ship an affected version, including nicegui.
| Package | Affected | Fixed in |
|---|---|---|
nicegui PyPI | All versions | 3.0.0 |
nicegui PyPI | All versions | 3.0.0 |
nicegui PyPI | All versions | 3.0.0 |
How do I fix CVE-2025-53354?
Upgrade nicegui to 3.0.0 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2025-53354 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-53354 exists.
Sources
Also known as GHSA-8c95-hpq2-w46f, PYSEC-2026-1699.