CVE-2026-39844: NiceGUI Path Traversal Vulnerability via Filename Sanitization Bypass

nicegui Updated 08 Apr 2026

Summary

08/04/2026
Yes i
Moderate
5.9

CVE-2026-39844: NiceGUI: Upload filename sanitization bypass via backslashes allows path traversal on Windows. Affects nicegui versions < 3.10.0. Fixed in 3.10.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

NiceGUI is an open-source Python library designed for building user interfaces for web applications. It simplifies the process of creating interactive web applications by providing a set of high-level components and tools. However, a vulnerability has been identified in its file upload functionality, which allows for path traversal attacks on Windows systems.

Vulnerability Detail

The vulnerability arises from inadequate filename sanitization in NiceGUI's file upload feature. Specifically, the use of PurePosixPath(filename).name fails to properly handle backslashes, which are treated as literal characters rather than path separators on Windows. This allows an attacker to bypass the intended sanitization, leading to potential arbitrary file writes outside the designated upload directory. The consequences include the risk of remote code execution, data integrity loss, and overwriting critical application files.

How To Fix

Latest published version: 3.18.0 as of 22 Oct 2026

pip install --upgrade "nicegui==3.18.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.10.0

This is the first release that contains the fix.

pip install --upgrade "nicegui==3.10.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, developers can manually validate and sanitize filenames before processing uploads. For example, you can implement a check to ensure that filenames do not contain backslashes or other potentially harmful characters. Here is a sample code snippet to illustrate this:

import re

def sanitize_filename(filename):
    # Remove backslashes and any other unwanted characters
    return re.sub(r'[\\]', '', filename)

# Usage
safe_filename = sanitize_filename(upload.filename)

Conclusion

In summary, CVE-2026-39844 presents a significant risk for applications using NiceGUI on Windows due to a path traversal vulnerability stemming from improper filename sanitization. It is crucial to update to the latest version or implement a workaround to ensure the security of your application.

See every vulnerability recorded for nicegui →

Share this vulnerability

FAQ

CVE-2026-39844 is a vulnerability in the NiceGUI package that allows for path traversal attacks due to improper filename sanitization on Windows systems.

If your application uses NiceGUI for file uploads on Windows, it may be susceptible to arbitrary file writes, which can lead to data loss or remote code execution.

You can implement a manual filename sanitization process as a temporary workaround until you can update to the patched version.

No, this vulnerability specifically affects Windows systems due to the way backslashes are handled in file paths.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can check your application without signup using the Vulert playground at Vulert Scanner.

Related vulnerabilities

Recent vulnerabilities recorded for nicegui.

How To Fix

Latest published version: 3.18.0 as of 22 Oct 2026

pip install --upgrade "nicegui==3.18.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.10.0

This is the first release that contains the fix.

pip install --upgrade "nicegui==3.10.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback