Vulnerabilities in pkg:pypi/nicegui

PACKAGE
Advisory Identifier: GHSA-pq7c-x8g4-rvp6
Advisory Summary

CVE-2026-45554 is a MODERATE (CVSS 5.3) remote code execution vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting NiceGUI libraries in the PyPI ecosystem. The issue involves unauthenticated log-volume denial of service in dynamic resource routes. Remediation is available by upgrading affected packages to version 3.12.0.

17 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/nicegui

17 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/nicegui. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pq7c-x8g4-rvp6 CVE-2026-45554 MODERATE NiceGUI: Unauthenticated log-volume denial of service in dynamic resource routes
GHSA-jfrm-rx66-g536 CVE-2026-45553 HIGH NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()
GHSA-9ffm-fxg3-xrhh CVE-2026-25732 HIGH NiceGUI's Path Traversal via Unsanitized FileUpload.name Enables Arbitrary File Write
GHSA-w8wv-vfpc-hw2w CVE-2026-39844 MODERATE NiceGUI: Upload filename sanitization bypass via backslashes allows path traversal on Windows
GHSA-w5g8-5849-vj76 CVE-2026-33332 MODERATE NiceGUI's unvalidated chunk size parameter in media routes can cause memory exhaustion
GHSA-78qv-3mpx-9cqq CVE-2026-27156 MODERATE NiceGUI vulnerable to XSS via Code Injection during client-side element function execution
GHSA-v82v-c5x8-w282 CVE-2026-25516 MODERATE NiceGUI's XSS vulnerability in ui.markdown() allows arbitrary JavaScript execution through unsanitized HTML content
GHSA-hxp3-63hc-5366 CVE-2025-66645 HIGH NiceGUI has a path traversal in app.add_media_files() allows arbitrary file read
GHSA-mp55-g7pj-rvm2 CVE-2026-21874 MODERATE NiceGUI has Redis connection leak via tab storage causes service degradation
GHSA-mhpg-c27v-6mxr CVE-2026-21873 HIGH NiceGUI apps which use `ui.sub_pages` vulnerable to zero-click XSS
GHSA-m7j5-rq9j-6jj9 CVE-2026-21872 MODERATE NiceGUI apps are vulnerable to XSS which uses `ui.sub_pages` and render arbitrary user-provided links
GHSA-7grm-h62g-5m97 CVE-2026-21871 MODERATE NiceGUI is vulnerable to XSS via Unescaped URL in ui.navigate.history.push() / replace()
GHSA-2m4f-cg75-76w2 CVE-2025-66470 MODERATE NiceGUI Stored/Reflected XSS in ui.interactive_image via unsanitized SVG content
GHSA-72qc-wxch-74mg CVE-2025-66469 MODERATE NiceGUI Reflected XSS in ui.add_css, ui.add_scss, and ui.add_sass via Style Injection
GHSA-8c95-hpq2-w46f CVE-2025-53354 MODERATE NiceGUI has a Reflected XSS
GHSA-v6jv-p6r8-j78w CVE-2025-21618 HIGH NiceGUI On Air authentication issue
GHSA-mwc7-64wg-pgvj CVE-2024-32005 HIGH NiceGUI allows potential access to local file system

CVE-2026-45554 at a Glance

CVE Identifier CVE-2026-45554
GHSA Identifier GHSA-pq7c-x8g4-rvp6
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product NiceGUI
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2026-45554

To remediate this vulnerability, upgrade all affected NiceGUI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nicegui fixed: 3.12.0
pip install nicegui>=3.12.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show nicegui

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-45554, inspect your installed packages using pip:

pip show nicegui

Analyze the terminal output to locate any version of NiceGUI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.12.0), your application is affected.

Note: The pip show nicegui command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In NiceGUI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Two FastAPI routes that serve per-component static assets in NiceGUI accept a sub-path parameter that may resolve to a directory rather than a file. Requests that resolve to a directory raise an unhandled `RuntimeError` inside Starlette's `FileResponse`, which Uvicorn writes to the server log as a full traceback. Because the routes are reachable without authentication, a remote attacker can amplify log volume and consume disk and log-pipeline capacity on any publicly reachable NiceGUI server. There is no impact to confidentiality or integrity. ### Details The affected routes are the per-component **resource** route (added in v1.4.6) and the **ESM module** route (added in v3.0.0). Both join a user-supplied path segment with a registered base directory and pass the result to `FileResponse`. The existing existence check uses `pathlib.Path.exists()`, which returns `True` for directories — so a request whose sub-path resolves to a directory passes the guard and triggers an unhandled exception inside Starlette. FastAPI has no default handler for `RuntimeError`, so each such request results in a 500 response and a multi-frame traceback in the server log. Other NiceGUI-served paths (`/static/...`, `/components/...`, `/libraries/...`) are not affected; they do not use the same sub-path-to-`FileResponse` pattern. ### Impact A remote, unauthenticated attacker can repeatedly trigger the error condition with crafted requests. Each request emits roughly 100 lines of traceback in a default setup, and more when additional middleware layers are present. At sustained request rates this can: - exhaust disk space on hosts with default log retention, - saturate downstream log-shipping pipelines, - generate alert fatigue or mask other events in monitoring. There is no remote code execution, no path traversal, and no data exposure beyond the absolute installation path that already appears in any uncaught exception trace. ### Workarounds For deployments that cannot upgrade immediately: - Place NiceGUI behind a reverse proxy that rejects requests where the path after `/_nicegui/<version>/esm/<key>/` or `/_nicegui/<version>/resources/<key>/` is empty. - Rate-limit the `/_nicegui/` prefix at the proxy. - Configure log rotation aggressively for the affected service.

CVE-2026-45554 Affected NiceGUI Versions

1 component(s)
Fixed Versions:
3.12.0
Product / Package Ecosystem Affected Versions Fixed Version
nicegui
PyPI
< 3.12.0
3.12.0

References

Frequently Asked Questions

What is CVE-2026-45554?
CVE-2026-45554 is a security vulnerability in NiceGUI involving Unauthenticated log-volume denial of service in dynamic resource routes under CWE-770: Allocation of Resources Without Limits or Throttling.
Which NiceGUI versions are affected?
Affected versions include releases prior to 3.12.0 across affected packages: nicegui.
What version fixes CVE-2026-45554?
Upgrading to 3.12.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nicegui affected?
Yes, nicegui is affected in releases prior to 3.12.0. Upgrade your dependency to 3.12.0 or later.
What is the CVSS score of CVE-2026-45554?
CVE-2026-45554 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2026-45554?
CVE-2026-45554 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check PyPI dependencies for CVE-2026-45554?
Run the dependency tree command: 'pip show nicegui'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pq7c-x8g4-rvp6",
  "modified" : "2026-06-09T10:58:12Z",
  "published" : "2026-05-18T20:22:07Z",
  "aliases" : [ "CVE-2026-45554" ],
  "summary" : "NiceGUI: Unauthenticated log-volume denial of service in dynamic resource routes",
  "details" : "### Summary\n\nTwo FastAPI routes that serve per-component static assets in NiceGUI accept a sub-path parameter that may resolve to a directory rather than a file. Requests that resolve to a directory raise an unhandled `RuntimeError` inside Starlette's `FileResponse`, which Uvicorn writes to the server log as a full traceback. Because the routes are reachable without authentication, a remote attacker can amplify log volume and consume disk and log-pipeline capacity on any publicly reachable NiceGUI server. There is no impact to confidentiality or integrity.\n\n### Details\n\nThe affected routes are the per-component **resource** route (added in v1.4.6) and the **ESM module** route (added in v3.0.0). Both join a user-supplied path segment with a registered base directory and pass the result to `FileResponse`. The existing existence check uses `pathlib.Path.exists()`, which returns `True` for directories — so a request whose sub-path resolves to a directory passes the guard and triggers an unhandled exception inside Starlette.\n\nFastAPI has no default handler for `RuntimeError`, so each such request results in a 500 response and a multi-frame traceback in the server log.\n\nOther NiceGUI-served paths (`/static/...`, `/components/...`, `/libraries/...`) are not affected; they do not use the same sub-path-to-`FileResponse` pattern.\n\n### Impact\n\nA remote, unauthenticated attacker can repeatedly trigger the error condition with crafted requests. Each request emits roughly 100 lines of traceback in a default setup, and more when additional middleware layers are present. At sustained request rates this can:\n\n- exhaust disk space on hosts with default log retention,\n- saturate downstream log-shipping pipelines,\n- generate alert fatigue or mask other events in monitoring.\n\nThere is no remote code execution, no path traversal, and no data exposure beyond the absolute installation path that already appears in any uncaught exception trace.\n\n### Workarounds\n\nFor deployments that cannot upgrade immediately:\n\n- Place NiceGUI behind a reverse proxy that rejects requests where the path after `/_nicegui/<version>/esm/<key>/` or `/_nicegui/<version>/resources/<key>/` is empty.\n- Rate-limit the `/_nicegui/` prefix at the proxy.\n- Configure log rotation aggressively for the affected service.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nicegui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.12.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.11.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-pq7c-x8g4-rvp6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45554"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/zauberzeug/nicegui"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zauberzeug/nicegui/releases/tag/v3.12.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248", "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-18T20:22:07Z",
    "nvd_published_at" : "2026-06-02T16:16:41Z"
  }
}