NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · PyPI

CVE-2026-33332: NiceGUI's unvalidated chunk size parameter in media routes can cause memory exhaustion

mediumCVSS 4.0 6.9 · 3.1 5.3GHSA-w5g8-5849-vj76

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

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 entries