CVE-2026-39844Medium· 5.9▾ SunlitNiceGUI: Upload filename sanitization bypass via backslashes allows path traversal on Windows
▾ Sunlit zone — Low / medium · no exploitation signal
impact 32.5 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 13.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
Last analysed / modified upstream
0.4%
The upload filename sanitization introduced in GHSA-9ffm-fxg3-xrhh uses PurePosixPath(filename).name to strip path components. Since PurePosixPath only recognizes forward slashes (/) as path separators, an attacker can bypass this sanitization on Windows by using backslashes (\) in the upload filename.
Applications that construct file paths using file.name (a pattern demonstrated in NiceGUI's bundled examples) are vulnerable to arbitrary file write on Windows.
The sanitization in nicegui/elements/upload_files.py uses:
filename = PurePosixPath(upload.filename or '').name
PurePosixPath treats backslashes as literal characters, not path separators:
>>> PurePosixPath('..\\..\\secret\\evil.txt').name
'..\\..\\secret\\evil.txt' # Not stripped!
When this filename is used in a path operation on Windows (e.g., Path('uploads') / file.name), Windows Path interprets backslashes as directory separators, resolving the path outside the intended directory.
On Windows deployments of NiceGUI applications that use file.name in path construction:
Linux and macOS are not affected, as they treat backslashes as literal filename characters.
nicegui < 3.10.0Upgrade to a patched release:
nicegui 3.10.0Connected by shared product, vendor, weakness, or advisory.
CVE-2026-33332Medium· 5.3NiceGUI's unvalidated chunk size parameter in media routes can cause memory exhaustion
CVE-2026-25516Medium· 6.1NiceGUI's XSS vulnerability in ui.markdown() allows arbitrary JavaScript execution through unsanitized HTML content
CVE-2026-45554Medium· 5.3NiceGUI: Unauthenticated log-volume denial of service in dynamic resource routes
CVE-2026-45553High· 7.5NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()
CVE-2026-27156Medium· 6.1NiceGUI vulnerable to XSS via Code Injection during client-side element function execution
CVE-2025-21618High· 7.5NiceGUI On Air authentication issue