CVE-2026-33332: NiceGUI's unvalidated chunk size parameter in media routes can cause memory exhaustion
Summary NiceGUI's app.addmediafile() and app.addmediafiles() 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.
Published Mar 19, 2026 · Updated Mar 27, 2026
Affected packages
nicegui
- Ecosystem
- PyPI
- Affected
- <= 3.8.0
- Fixed in
- 3.9.0
- Check
pip show nicegui
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to aest3ra, oxqnd, mjkim610, evnchn, Khaliun-sw1, falkoschindler.
References
- https://github.com/zauberzeug/nicegui/security/advisories/GHSA-w5g8-5849-vj76
- https://nvd.nist.gov/vuln/detail/CVE-2026-33332
- https://github.com/zauberzeug/nicegui/commit/9026962b8c4f3f225c98b2fbc35aa6b60cb3495b
- https://github.com/zauberzeug/nicegui/releases/tag/v3.9.0
- https://github.com/advisories/GHSA-w5g8-5849-vj76
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-45553
NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()
high7.5May 18, 2026CVE-2026-45554
NiceGUI: Unauthenticated log-volume denial of service in dynamic resource routes
medium5.3May 18, 2026CVE-2026-39844
NiceGUI: Upload filename sanitization bypass via backslashes allows path traversal on Windows
medium5.9Apr 8, 2026CVE-2026-27156
NiceGUI vulnerable to XSS via Code Injection during client-side element function execution
medium6.1Feb 24, 2026CVE-2026-25516
NiceGUI's XSS vulnerability in ui.markdown() allows arbitrary JavaScript execution through unsanitized HTML content
medium6.1Feb 5, 2026CVE-2026-25732
NiceGUI's Path Traversal via Unsanitized FileUpload.name Enables Arbitrary File Write
high7.5Feb 5, 2026
