GitHub Advisoryadvisory · PyPI
GHSA-w5g8-5849-vj76 NiceGUI's unvalidated chunk size parameter in media routes can cause memory exhaustion
MEDIUM
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
References
- https://github.com/zauberzeug/nicegui/security/advisories/GHSA-w5g8-5849-vj76 web
- https://nvd.nist.gov/vuln/detail/CVE-2026-33332 advisory
- https://github.com/zauberzeug/nicegui/commit/9026962b8c4f3f225c98b2fbc35aa6b60cb3495b web
- https://github.com/zauberzeug/nicegui package
- https://github.com/zauberzeug/nicegui/releases/tag/v3.9.0 web