CVE-2024-32005: Nicegui NiceGUI Allows Potential Access To Vulnerability

HIGH
Advisory Identifier: GHSA-mwc7-64wg-pgvj
CVSS 8.2
CWE-23 CWE-22
Published
Advisory Summary

CVE-2024-32005 is a HIGH (CVSS 8.2) nicegui allows potential access to vulnerability (CWE-23: Relative Path Traversal) affecting Nicegui libraries in the PyPI ecosystem. The issue involves nicegui allows potential access to local file system. Remediation is available by upgrading affected packages to version 1.4.21.

CVE-2024-32005 at a Glance

CVE Identifier CVE-2024-32005
GHSA Identifier GHSA-mwc7-64wg-pgvj
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-23: Relative Path Traversal
Affected Product Nicegui
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-32005

To remediate this vulnerability, upgrade all affected Nicegui dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nicegui fixed: 1.4.21
pip install nicegui>=1.4.21
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show nicegui

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-32005, inspect your installed packages using pip:

pip show nicegui

Analyze the terminal output to locate any version of Nicegui in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.21), your application is affected.

Note: The pip show nicegui command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. In Nicegui, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

NiceGUI is an easy-to-use, Python-based UI framework. A local file inclusion is present in the NiceUI leaflet component when requesting resource files under the `/_nicegui/{__version__}/resources/{key}/{path:path}` route. As a result any file on the backend filesystem which the web server has access to can be read by an attacker with access to the NiceUI leaflet website. This vulnerability has been addressed in version 1.4.21. Users are advised to upgrade. There are no known workarounds for this vulnerability.

CVE-2024-32005 Affected Nicegui Versions

1 component(s)
Fixed Versions:
1.4.21
Product / Package Ecosystem Affected Versions Fixed Version
nicegui
PyPI
≥ 1.4.6
< 1.4.21
1.4.21

References

Frequently Asked Questions

What is CVE-2024-32005?
CVE-2024-32005 is a security vulnerability in Nicegui involving NiceGUI allows potential access to local file system under CWE-23: Relative Path Traversal.
Which Nicegui versions are affected?
Affected versions include releases prior to 1.4.21 across affected packages: nicegui.
What version fixes CVE-2024-32005?
Upgrading to 1.4.21 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nicegui affected?
Yes, nicegui is affected in releases prior to 1.4.21. Upgrade your dependency to 1.4.21 or later.
What is the CVSS score of CVE-2024-32005?
CVE-2024-32005 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L.
What CWE is associated with CVE-2024-32005?
CVE-2024-32005 is classified under CWE-23: Relative Path Traversal (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.).
How can I check PyPI dependencies for CVE-2024-32005?
Run the dependency tree command: 'pip show nicegui'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mwc7-64wg-pgvj",
  "modified" : "2024-04-15T19:41:53Z",
  "published" : "2024-04-12T21:23:16Z",
  "aliases" : [ "CVE-2024-32005" ],
  "summary" : "NiceGUI allows potential access to local file system",
  "details" : "NiceGUI is an easy-to-use, Python-based UI framework. A local file inclusion is present in the NiceUI leaflet component when requesting resource files under the `/_nicegui/{__version__}/resources/{key}/{path:path}` route. \n\nAs a result any file on the backend filesystem which the web server has access to can be read by an attacker with access to the NiceUI leaflet website. \n\nThis vulnerability has been addressed in version 1.4.21. Users are advised to upgrade. There are no known workarounds for this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nicegui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.6"
      }, {
        "fixed" : "1.4.21"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-mwc7-64wg-pgvj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-32005"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zauberzeug/nicegui/commit/ed12eb14f2a6c48b388a05c04b3c5a107ea9d330"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/zauberzeug/nicegui"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/29ec621a-bd69-4225-ab0f-5bb8a1d10c67"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-23" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-12T21:23:16Z",
    "nvd_published_at" : "2024-04-12T21:15:11Z"
  }
}