Skip to content

← Actionable
Medium, CVSS 6.1amended

NiceGUI Reflected XSS in ui.add_css, ui.add_scss, and ui.add_sass via Style Injection

CVE-2025-66469GHSA-72qc-wxch-74mg

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (nicegui 3.4.0), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • PyPI nicegui

    Affected
    <= 3.3.1
    Fixed in
    3.4.0

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
6.1 · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
EPSS
  • CVE-2025-66469: 0.27% estimated exploitation activity in the next 30 days; percentile 19.97 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary A Cross-Site Scripting (XSS) vulnerability exists in ui.addcss, ui.addscss, and ui.addsass 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.runjavascript (or addheadhtml internally) without sufficient escaping for the transport layer. ui.addcss: Injects content into a <style tag. Input containing </style closes the tag prematurely, allowing subsequent HTML/JS injection. ui.addscss / ui.addsass: 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…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-72qc-wxch-74mg

  2. Revision 1 · created ·

    Published from osv record GHSA-72qc-wxch-74mg

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2025-66469

Advisory: NiceGUI Reflected XSS in ui.add_css, ui.add_scss, and ui.add_sass via Style Injection
IDs: CVE-2025-66469, GHSA-72qc-wxch-74mg
Record: https://patchnext.com/advisories/cve-2025-66469 (revision 2, source checked 26 Oct 2026, 13:36 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 6.1)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: nicegui 3.4.0. A vendor fix does not mean a deployment is fixed.

## Affected components
- PyPI nicegui: affected <= 3.3.1; fixed in 3.4.0

## Suggested inspection (read-only)
- `python -m pip show nicegui`: prints the installed version. Run with the environment that serves production active.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on nicegui.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-72qc-wxch-74mg (OSV record GHSA-72qc-wxch-74mg lists affected ranges: PyPI nicegui >=0 <3.4.0 (fixed))
- Verified: https://github.com/advisories/GHSA-72qc-wxch-74mg (GitHub-reviewed advisory GHSA-72qc-wxch-74mg lists affected ranges: PyPI nicegui >=0 <=3.3.1)

Commands are suggestions: review each one before running it.

Loading voting…