NiceGUI
CVE-2025-66645
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify NiceGUI app with media endpoint
-
DeliverySend GET with URL-encoded ../ traversal
-
ExploitPath join escapes served directory
-
ExecutionServer returns arbitrary file contents
-
ImpactExfiltrate secrets and config
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The affected application must call App.add_media_files(url_path, local_directory) to expose a server directory; this endpoint uses a {filename:path} route parameter that accepts '../' (and URL-encoded %2e%2e) sequences and joins them to local_directory without a canonicalized boundary check. Once that feature is configured, exploitation is remote and unauthenticated (PR:N) against the exposed route with no user interaction. Limiting factors: NiceGUI does not serve media files this way unless the developer explicitly enables it, and readable files are bounded by the OS permissions of the server process; there is no integrity or availability impact. Fixed in 3.4.0 via path resolution and is_relative_to() validation. |
| Impact | Multiple signals align toward a genuine but conditional risk. The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N, C:H only) scores 7.5 and is internally consistent with the GHSA description and the PoC: a remote, unauthenticated attacker reads arbitrary files over HTTP using URL-encoded traversal sequences (%2e%2e), with high confidentiality impact and no integrity/availability effect. POC availability is CONFIRMED (public GHSA advisory GHSA-hxp3-63hc-5366 with working curl against /etc/hosts and a source-level root-cause analysis), which raises practical exploitability above a theoretical finding. However, this is NOT confirmed active exploitation - it is not in CISA KEV, so per precision rules the status is 'publicly available exploit code exists', which is distinct from in-the-wild use. EPSS is modest (1.12%, 66th percentile), consistent with a known-but-not-mass-exploited library bug. The key limiting factor not captured by the CVSS score is that exploitation requires the target application to actually call App.add_media_files() to expose a directory; NiceGUI apps do not serve media this way by default. Net: a real, confirmed, trivially exploitable arbitrary-file-read when the vulnerable feature is in use, but its blast radius is gated by that configuration, making it a priority-patch item for affected deployments rather than a universal emergency. |
| Exploit ScenarioDerived | A developer uses app.add_media_files('/media', MEDIA_DIR) to serve a media folder. A remote unauthenticated attacker sends GET /media/%2e%2e/%2e%2e/%2e%2e/etc/hosts; the path parameter accepts traversal sequences and the server returns the file contents (HTTP 200). A public PoC in the GHSA advisory demonstrates this exact read of /etc/hosts, and the technique extends to source code, config files, and secrets (e.g. .env) readable by the process. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 14, 2026
Remote arbitrary file read in NiceGUI versions 3.3.1 and below affects applications that explicitly call App.add_media_files() to expose a directory; publicly available exploit code exists, though no CISA KEV listing was provided. An unauthenticated network attacker can use URL-encoded traversal sequences such as %2e%2e against the exposed media route to read files outside the configured directory, potentially exposing source code, configuration files, or /etc/hosts, subject to the server process's file permissions. EPSS is 1.12% (66th percentile), and the vendor has fixed the issue in 3.4.0.
RemediationAI
Upgrade to NiceGUI 3.4.0 or later, for example with pip install --upgrade "nicegui>=3.4.0"; this is the vendor-released patch and fixes the path traversal through path resolution and is_relative_to() validation. Review the advisory at https://github.com/zauberzeug/nicegui/security/advisories/GHSA-hxp3-63hc-5366 and the fix commit at https://github.com/zauberzeug/nicegui/commit/a1b89e2a24e1911a40389ace2153a37f4eea92a9. If upgrading immediately is not possible, avoid calling App.add_media_files() for directories that contain sensitive files, or remove the feature entirely if it is not needed; this eliminates exposure but may break intended media serving. As a compensating control, run the NiceGUI server process with minimal filesystem privileges so traversal can only read files the process already can access, and consider blocking URL-encoded traversal sequences at a reverse proxy for the media route, though proxy filtering can be bypassed by alternate encodings and may create false positives.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
NiceGUI is a Python-based UI framework that can register HTTP routes for serving files. The vulnerable method App.add_media_files(url_path, local_directory) registers a GET endpoint using a {filename:path} route parameter, which accepts path separators and traversal sequences. The original implementation simply joined local_directory with the attacker-controlled filename and checked file existence, without canonicalizing the result or verifying that the resolved path remained inside the intended directory, matching CWE-22 (Path Traversal). The vendor fix resolves both the configured local directory and the requested file path, then validates with is_relative_to() to reject escapes. The CPE cpe:2.3:a:zauberzeug:nicegui:*:*:*:*:*:*:*:* is version-agnostic for this CPE reporting scheme, so it should be correlated with the vendor's fixed version 3.4.0 and the package range pip/nicegui < 3.4.0. The commit also adds a regression test using a .env secret file and requests such as /media/%2e%2e/.env, expecting a 404 rather than file contents.
Know when Nicegui gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Remote unauthenticated HTTP request with trivial encoded traversal (AV:N/AC:L/PR:N/UI:N); arbitrary file read gives C:H with no write or availability impact (I:N/A:N).
Primary rating from Vendor (github).
CVSS VectorVendor: github
DescriptionCVE.org
NiceGUI is a Python-based UI framework. Versions 3.3.1 and below are vulnerable to directory traversal through the App.add_media_files() function, which allows a remote attacker to read arbitrary files on the server filesystem. This issue is fixed in version 3.4.0.
Executive ViewAI
NiceGUI 3.3.1 and earlier contain a remote arbitrary file read flaw affecting applications that explicitly expose a directory through App.add_media_files(), and publicly available exploit code exists. Only deployments using that specific feature are exposed, but where present an attacker could retrieve configuration or source files that may contain credentials. Security leadership should direct teams to identify and upgrade affected applications to 3.4.0.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Affected Products (CPE)CVE.org
Path traversal in NiceGUI before 3.7.0 allows remote attackers to write arbitrary files outside intended directories by
NiceGUI versions 2.22.0 through 3.4.1 contain a cross-site DOM-based XSS vulnerability in the pushstate event listener f
Stored or reflected cross-site scripting in NiceGUI 3.3.1 and earlier lets an attacker execute arbitrary HTML and JavaSc
NiceGUI versions 2.22.0 through 3.4.1 contain a stored cross-site scripting vulnerability in the click event listener of
Cross-site scripting (XSS) in NiceGUI versions 2.13.0 through 3.4.1 allows attackers to execute arbitrary JavaScript in
Cross-site scripting in NiceGUI's ui.markdown() component allows unauthenticated attackers to inject malicious HTML and
Reflected cross-site scripting in NiceGUI 3.3.1 and earlier lets remote unauthenticated attackers inject arbitrary JavaS
NiceGUI versions 2.10.0 through 3.4.1 fail to properly release Redis connections when users open and close browser tabs,
NiceGUI versions prior to 3.8.0 are vulnerable to stored cross-site scripting (XSS) through multiple APIs that improperl
NVD
CVE.org
EPSS
GitHub
Exploit-DB