# CVE-2025-66469: nicegui XSS — Fixed in 3.4.0

🐍

🐍 PyPI

Not in CISA KEV

MEDIUM severity

# CVE-2025-66469 — nicegui

MEDIUM [Fix: zauberzeug/nicegui@a8fd25b](https://github.com/zauberzeug/nicegui/commit/a8fd25b7d5e23afb1952d0f60a1940e18b5f1ca8)

CVE-2025-66469 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in nicegui. A fix is available for nicegui — see the affected versions and patch details below.

NiceGUI Reflected XSS in ui.add\_css, ui.add\_scss, and ui.add\_sass via Style Injection

Also known as[GHSA-72qc-wxch-74mg](/vulnerability/GHSA-72qc-wxch-74mg)PYSEC-2026-1697

Published

Dec 8, 2025

Updated

Oct 28, 2026

Affected

1 pkg

Patched

1 / 1

Exploits

None indexed

Exploitation data as of Nov 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

## Exploitation Status

### Proof-of-concept exploit code exists

-   CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.

Exploitation and automatability from CISA’s SSVC triage for CVE-2025-66469.

## EPSS Exploitation Probability

[via FIRST.org ↗](https://www.first.org/epss/)

0.3%probability of exploitation in next 30 days

Lower Risk+0.02%

Lower risk than most CVEs22th percentile — riskier than 22% of all scored CVEsHighest risk

0.00%0.27%0.53%0.80%0.1%0.3%May 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from [FIRST.org EPSS](https://www.first.org/epss/).

## How urgent is this, really

## Where this sits among everything scored

## Real-World Exposure

1 pkg affected

🐍`nicegui`

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

## Description

#### Summary

A Cross-Site Scripting (XSS) vulnerability exists in `ui.add_css`, `ui.add_scss`, and `ui.add_sass` functions in NiceGUI (v3.3.1 and earlier).

These functions allow developers to inject styles dynamically. However, they 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.

#### Details

The vulnerability stems from how these functions inject content into the DOM using `client.run_javascript` (or `add_head_html` internally) without sufficient escaping for the transport layer.

-   **`ui.add_css`**: Injects content into a `<style>` tag. Input containing `</style>` closes the tag prematurely, allowing subsequent HTML/JS injection.
-   **`ui.add_scss` / `ui.add_sass`**: These rely on client-side compilation within `<script>` tags. Input containing `</script>` breaks the execution context, allowing XSS.

#### PoC

**Scenario:** A developer allows users to customize a theme color via a URL parameter.

```
from nicegui import ui

@ui.page('/')
def main(color: str = 'blue'):
    # Vulnerable implementation of dynamic theming
    ui.add_css(f'.q-btn {{ background-color: {color} !important; }}')
    ui.button('Click Me')

ui.run(port=8082)
```

**Attack Vector:** Accessing the following URL executes arbitrary JavaScript: `http://localhost:8082/?color=red;}</style><img src=x onerror=alert(document.domain)><style>`

#### Impact

-   **Type:** Reflected XSS
-   **Severity:** Moderate
-   **Affected Components:** Applications using `ui.add_css`, `ui.add_scss`, or `ui.add_sass` with untrusted input (e.g., dynamic theming based on user input).

## Affected Packages

1 total 1 fixed

Ecosystem

Package

Vulnerable range

Fix

🐍PyPI

`nicegui` 

all versions

3.4.0`pip install --upgrade 'nicegui==3.4.0'`

## Affected Products

1 product · 1 configurations

Application

`nicegui`zauberzeug

< 3.4.0

range

## Detection & mitigation playbook

Open-source dependency

1.  ### Detect
    
    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for nicegui, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
    
2.  ### Fix
    
    Update nicegui to 3.4.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-66469 is resolved across your whole dependency graph.
    
3.  ### Workarounds
    
    Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
    

## Frequently Asked Questions

\### Summary A Cross-Site Scripting (XSS) vulnerability exists in \`ui.add\_css\`, \`ui.add\_scss\`, and \`ui.add\_sass\` functions in NiceGUI (v3.3.1 and earlier). These functions allow developers to inject styles dynamically. However, they 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. ### Details The vulnerability stems from how these functions inject content into the DOM using \`client.

O3 Security · Impact-Aware SCA

### Is CVE-2025-66469 in your dependencies?

Find it across PyPI, including transitive dependencies.

[Scan my dependencies](/book-demo) [How O3 SCA works](/impact-aware-sca)