---
schema_version: '1.0'
id: security-20260812-45f6f6
title: 'CVE-2026-33332: NiceGUI''s unvalidated chunk size parameter in media routes
  can cause memory exhaustion'
url: https://osv.dev/vulnerability/GHSA-w5g8-5849-vj76
url_hash: 45f6f624ee278f005d58f93734985414470917fa16bdb76bac21151d4f752d14
canonical_url: https://osv.dev/vulnerability/GHSA-w5g8-5849-vj76
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-33332
- GHSA-w5g8-5849-vj76
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- nicegui
- PyPI
lang: en
published_at: '2026-03-19T18:48:27Z'
fetched_at: '2026-08-12T16:00:04.486343Z'
updated_at: '2026-08-22T14:41:30Z'
status: published
content_hash: 370cd719c0d30f8570fc6b6eb2425db8c40a8671c634a4b986fcb85e6526ab68
content_changed_at: '2026-08-22T13:15:21.571996Z'
license_note: full
summary: NiceGUI's unvalidated chunk size parameter in media routes can cause memory
  exhaustion
summary_source: rss
summary_en: NiceGUI's unvalidated chunk size parameter in media routes can cause memory
  exhaustion
summary_omitted_reason: null
redistribution: true
keywords_en:
- can
- cause
- chunk
- CVE
- CVE-2026-33332
- exhaustion
- GHSA-w5g8-5849-vj76
- library vulnerability
- media
- memory
- nicegui
- parameter
- PyPI
- routes
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- size
- software security
- unvalidated
entities_en:
- name: CVE
  type: data
- name: PyPI
  type: artifact
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: PyPI
  type: artifact
related_auto:
- name: Portal
  type: organization
  weight: 1.0
- name: Hugging Face
  type: organization
  weight: 1.0
computed_at: '2026-08-22T14:41:26Z'
---

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

## TL;DR
NiceGUI's unvalidated chunk size parameter in media routes can cause memory exhaustion

## Key Points
- cve / CVE-2026-33332 / GHSA-w5g8-5849-vj76 / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L / nicegui / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
**Advisory:** GHSA-w5g8-5849-vj76 (CVE-2026-33332)

**Details:**
## 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.

**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
- https://github.com/zauberzeug/nicegui/releases/tag/v3.9.0

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-w5g8-5849-vj76_

## Source
元記事: [CVE-2026-33332: NiceGUI's unvalidated chunk size parameter in media routes can cause memory exhaustion](https://osv.dev/vulnerability/GHSA-w5g8-5849-vj76) — published 2026-03-19T18:48:27Z
