CVE-2026-33332: Nicegui NiceGUI's Unvalidated Chunk Size Parameter Vulnerability
MODERATECVE-2026-33332 is a MODERATE (CVSS 5.3) nicegui's unvalidated chunk size parameter vulnerability (CWE-20: Improper Input Validation) affecting Nicegui libraries in the PyPI ecosystem. The issue involves nicegui's unvalidated chunk size parameter in media routes can cause memory exhaustion. Remediation is available by upgrading affected packages to version 3.9.0.
CVE-2026-33332 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2026-33332
To remediate this vulnerability, upgrade all affected Nicegui dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install nicegui>=3.9.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show nicegui
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-33332, inspect your installed packages using pip:
pip show nicegui
Analyze the terminal output to locate any version of Nicegui in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.9.0), your application is affected.
Note: The pip show nicegui command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Nicegui, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-33332 Affected Nicegui Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nicegui
|
PyPI |
< 3.9.0
|
3.9.0
|
References
Frequently Asked Questions
What is CVE-2026-33332?
Which Nicegui versions are affected?
What version fixes CVE-2026-33332?
Is nicegui affected?
What is the CVSS score of CVE-2026-33332?
What CWE is associated with CVE-2026-33332?
How can I check PyPI dependencies for CVE-2026-33332?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w5g8-5849-vj76",
"modified" : "2026-03-27T21:57:40Z",
"published" : "2026-03-19T18:48:27Z",
"aliases" : [ "CVE-2026-33332" ],
"summary" : "NiceGUI's unvalidated chunk size parameter in media routes can cause memory exhaustion",
"details" : "## Summary\n\nNiceGUI'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.\n\nWith large media files and concurrent requests, this can lead to excessive memory consumption, degraded performance, or denial of service.\n\n## Impact\n\n**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).\n\n**What an attacker can do:**\n- Force the server to load entire files into memory instead of streaming them in chunks\n- Amplify memory usage with concurrent requests to large media files\n- Cause performance degradation, memory pressure, and potential OOM conditions\n\n**Attack difficulty:** Low - requires only a crafted query parameter.\n\n## Remediation\n\nUpgrade to a patched version of NiceGUI.\n\nAs a workaround, restrict access to media endpoints or strip unexpected query parameters at a reverse proxy layer.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "nicegui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.9.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.8.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-w5g8-5849-vj76"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33332"
}, {
"type" : "WEB",
"url" : "https://github.com/zauberzeug/nicegui/commit/9026962b8c4f3f225c98b2fbc35aa6b60cb3495b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/zauberzeug/nicegui"
}, {
"type" : "WEB",
"url" : "https://github.com/zauberzeug/nicegui/releases/tag/v3.9.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-770" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-19T18:48:27Z",
"nvd_published_at" : "2026-03-24T20:16:28Z"
}
}