GitHub Advisoryadvisory · PyPI

GHSA-w5g8-5849-vj76 NiceGUI's unvalidated chunk size parameter in media routes can cause memory exhaustion

MEDIUM Published 2026-03-19 Modified 2026-03-27 Official page ↗
Aliases
CVE-2026-33332
Ecosystem
PyPI
Packages
nicegui
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weaknesses
CWE-20, CWE-770
Reviewed
2026-03-19

Affected packages

• PyPI nicegui: < 3.9.0 → fixed in 3.9.0

Description

Summary NiceGUI's `app.add_media_file()` and `app.add_media_files()` media routes accept a user-controlled query parameter that influences how files are read during streaming. The parameter is passed to the range-response implementation without validation, allowing an attacker to bypass chunked streaming and force the server to load entire files into memory at once. With large media files and concurrent requests, this can lead to excessive memory consumption, degraded performance, or denial of service. Impact Affected applications: NiceGUI applications that serve media content via `app.add_media_file()` or `app.add_media_files()`, particularly those serving large files (video, audio). What an attacker can do: • Force the server to load entire files into memory instead of streaming them in chunks • Amplify memory usage with concurrent requests to large media files • Cause performance degradation, memory pressure, and potential OOM conditions Attack difficulty: Low - requires only a crafted query parameter. Remediation Upgrade to a patched version of NiceGUI. As a workaround, restrict access to media endpoints or strip unexpected query parameters at a reverse proxy layer.

Related

Alias · CVE (1)

  • CVE-2026-33332 NiceGUI is a Python-based UI framework. vulnerability

Weakness · CWE (2)

  • CWE-20 Improper Input Validation weakness
  • CWE-770 Allocation of Resources Without Limits or Throttling weakness

References