{"id":"CVE-2026-39844","aliases":["CVE-2026-39844","GHSA-w8wv-vfpc-hw2w","PYSEC-2026-2234"],"related":[],"kind":"vulnerability","state":"published","title":"NiceGUI has a Path Traversal in NiceGUI Upload Filename on Windows via Backslash Bypass of PurePosixPath Sanitization","summary":"NiceGUI is a Python-based UI framework. Prior to 3.10.0, 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. This vulnerability is fixed in 3.10.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"NiceGUI is a Python-based UI framework. Prior to 3.10.0, 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. This vulnerability is fixed in 3.10.0.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe 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.\n\nApplications that construct file paths using `file.name` (a pattern demonstrated in NiceGUI's bundled examples) are vulnerable to arbitrary file write on Windows.\n\n### Details\n\nThe sanitization in `nicegui/elements/upload_files.py` uses:\n\n```python\nfilename = PurePosixPath(upload.filename or '').name\n```\n\n`PurePosixPath` treats backslashes as literal characters, not path separators:\n\n```python\n>>> PurePosixPath('..\\\\..\\\\secret\\\\evil.txt').name\n'..\\\\..\\\\secret\\\\evil.txt'  # Not stripped!\n```\n\nWhen 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.\n\n### Impact\n\nOn Windows deployments of NiceGUI applications that use `file.name` in path construction:\n\n- **Arbitrary file write** outside the intended upload directory\n- **Potential remote code execution** through overwriting application files or placing executables in known locations\n- **Data integrity loss** through overwriting existing files\n\nLinux and macOS are not affected, as they treat backslashes as literal filename characters.","format":"markdown","source":"ghsa"},{"lang":"es","text":"NiceGUI es un framework de UI basado en Python. Antes de la versión 3.10.0, dado que PurePosixPath solo reconoce las barras diagonales (/) como separadores de ruta, un atacante puede eludir esta sanitización en Windows utilizando barras invertidas (\\) en el nombre de archivo de la carga. Las aplicaciones que construyen rutas de archivo utilizando file.name (un patrón demostrado en los ejemplos incluidos de NiceGUI) son vulnerables a la escritura arbitraria de archivos en Windows. Esta vulnerabilidad se corrigió en la versión 3.10.0.","source":"nvd"}],"published":"2026-04-08T15:04:13.000Z","modified":"2026-07-24T21:10:00.143Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 3.10.0","status":"affected"}],"vendor":"zauberzeug","product":"nicegui","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.10.0"}],"ecosystem":"PyPI","package":"nicegui","purl":"pkg:pypi/nicegui","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.10.0"}],"vendor":"zauberzeug","product":"nicegui","cpe":"cpe:2.3:a:zauberzeug:nicegui:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.10.0"}],"ecosystem":"PyPI","package":"nicegui","purl":"pkg:pypi/nicegui","source":"pysec"}],"references":[{"url":"https://github.com/zauberzeug/nicegui/security/advisories/GHSA-w8wv-vfpc-hw2w","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/zauberzeug/nicegui/commit/d38a702e3af2da5b0708f689be8d71413fc77056","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/zauberzeug/nicegui/releases/tag/v3.10.0","tags":["advisory","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-39844","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/zauberzeug/nicegui","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-09T14:55:44.846Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-39844","url":"https://www.cve.org/CVERecord?id=CVE-2026-39844","licence":"CVE Terms of Use","modified":"2026-04-09T16:17:11.748Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w8wv-vfpc-hw2w","url":"https://github.com/advisories/GHSA-w8wv-vfpc-hw2w","licence":"CC-BY-4.0","modified":"2026-07-13T07:26:38.482Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-39844","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-39844","licence":"Public domain","modified":"2026-07-24T21:10:00.143Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2234","url":"https://osv.dev/vulnerability/PYSEC-2026-2234","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:35.271Z"}],"updatedAt":"2026-11-25T22:59:18.312Z","epss":{"score":0.00394,"percentile":0.35715,"date":"2026-12-01T12:00:22.000Z"}}