NiceGUI: Unauthenticated log-volume denial of service in dynamic resource routes
Description
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//esm//or/_nicegui//resources//is empty. - Rate-limit the
/_nicegui/prefix at the proxy. - Configure log rotation aggressively for the affected service.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
NiceGUI's per-component resource and ESM module routes lack directory checks, letting unauthenticated attackers trigger verbose log traces and exhaust disk/log capacity.
Vulnerability
Two FastAPI routes in NiceGUI — the per-component resource route (added in v1.4.6) and the ESM module route (added in v3.0.0) — accept a user-supplied sub-path parameter that is joined with a registered base directory and passed to Starlette's FileResponse [1], [2]. The existence check uses pathlib.Path.exists(), which returns True for directories, so a request that resolves to a directory passes the guard. Starlette then raises an unhandled RuntimeError inside FileResponse, and Uvicorn writes a full traceback to the server log. Other NiceGUI-served paths (/static/..., /components/..., /libraries/...) are not affected [2].
Exploitation
A remote, unauthenticated attacker can send crafted HTTP requests to the affected routes with a sub-path that resolves to an existing directory on the server [2]. Each request triggers the error path, producing a 500 response and approximately 100 lines of traceback log output in a default setup (more with additional middleware layers) [2]. No authentication or special network position is required; the attacker only needs network access to a publicly reachable NiceGUI server.
Impact
The sustained emission of verbose log entries can exhaust disk space on hosts with default log retention, saturate downstream log-shipping pipelines, and generate alert fatigue or mask other security-relevant events [2]. 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 [2]. Confidentiality and integrity are not compromised.
Mitigation
The official fix is not yet disclosed in the available references; however, the advisory recommends placing NiceGUI behind a reverse proxy that rejects requests where the path after /_nicegui ends with a slash or points to a known directory [2], [3]. Users should monitor the NiceGUI repository [1] and the GitHub Advisory [2] for a patched release.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2<= 3.11.1+ 1 more
- (no CPE)range: <= 3.11.1
- (no CPE)range: >=1.4.6
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
2News mentions
0No linked articles in our index yet.