CVE-2026-45553: NiceGUI Local File Disclosure Vulnerability

HIGH
Advisory Identifier: GHSA-jfrm-rx66-g536
CVSS 7.5
CWE-200
Published
Advisory Summary

CVE-2026-45553 is a HIGH (CVSS 7.5) local file disclosure vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting NiceGUI libraries in the PyPI ecosystem. The issue involves local file disclosure via docutils file insertion in ui.restructured_text(). Remediation is available by upgrading affected packages to version 3.12.0.

CVE-2026-45553 at a Glance

CVE Identifier CVE-2026-45553
GHSA Identifier GHSA-jfrm-rx66-g536
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product NiceGUI
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N).

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 None (A:N)

How to Fix CVE-2026-45553

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: 3.12.0
pip install nicegui>=3.12.0
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-2026-45553, 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 3.12.0), 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. 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

### Summary `ui.restructured_text()` renders reStructuredText server-side with Docutils without disabling file insertion directives. When a NiceGUI application passes attacker-controlled content to `ui.restructured_text()`, an attacker can use standard Docutils directives (`include`, `csv-table` with `:file:`, `raw` with `:file:`) to read local files readable by the NiceGUI server process. Applications that only pass trusted static strings to `ui.restructured_text()` are not affected. ### Details The affected component is the reStructuredText renderer: - File: `nicegui/elements/restructured_text.py` - Function: `prepare_content()` `prepare_content()` renders user-supplied reStructuredText through Docutils: ```python html = publish_parts( remove_indentation(content), writer_name='html4', settings_overrides={'syntax_highlight': 'short'}, ) ``` The Docutils call only sets `syntax_highlight`. It does not disable file insertion or raw directives, so Docutils processes directives that read local files and embed their contents into the generated HTML before it is returned to the browser. Frontend sanitization cannot prevent this because the file has already been read server-side. A minimal vulnerable usage pattern is any page that forwards untrusted input into `ui.restructured_text()`, e.g. content taken from query parameters, form fields, or other user-controlled sources. ### Impact Local file disclosure. An attacker who can supply reStructuredText content can read files accessible to the NiceGUI server process. Depending on deployment, this may expose: - application `.env` files - database URLs, API tokens, session/storage secrets - OAuth or cloud credentials - Docker or Kubernetes mounted secrets - application source files - logs and other process-readable files The confirmed impact is confidentiality loss through arbitrary local file read. Applications are only impacted when they pass untrusted or user-controlled reStructuredText into `ui.restructured_text()`. ### Recommended fix Disable unsafe Docutils features in `prepare_content()`: ```python html = publish_parts( remove_indentation(content), writer_name='html4', settings_overrides={ 'syntax_highlight': 'short', 'file_insertion_enabled': False, 'raw_enabled': False, '_disable_config': True, }, ) ``` This blocks the `include`, `csv-table :file:`, and `raw :file:` directives as well as local `docutils.conf` overrides.

CVE-2026-45553 Affected NiceGUI Versions

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

References

Frequently Asked Questions

What is CVE-2026-45553?
CVE-2026-45553 is a security vulnerability in NiceGUI involving Local file disclosure via Docutils file insertion in ui.restructured_text() under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which NiceGUI versions are affected?
Affected versions include releases prior to 3.12.0 across affected packages: nicegui.
What version fixes CVE-2026-45553?
Upgrading to 3.12.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nicegui affected?
Yes, nicegui is affected in releases prior to 3.12.0. Upgrade your dependency to 3.12.0 or later.
What is the CVSS score of CVE-2026-45553?
CVE-2026-45553 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-45553?
CVE-2026-45553 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check PyPI dependencies for CVE-2026-45553?
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-jfrm-rx66-g536",
  "modified" : "2026-06-09T10:58:07Z",
  "published" : "2026-05-18T20:21:59Z",
  "aliases" : [ "CVE-2026-45553" ],
  "summary" : "NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()",
  "details" : "### Summary\n\n`ui.restructured_text()` renders reStructuredText server-side with Docutils without disabling file insertion directives.\n\nWhen a NiceGUI application passes attacker-controlled content to `ui.restructured_text()`, an attacker can use standard Docutils directives (`include`, `csv-table` with `:file:`, `raw` with `:file:`) to read local files readable by the NiceGUI server process.\n\nApplications that only pass trusted static strings to `ui.restructured_text()` are not affected.\n\n### Details\n\nThe affected component is the reStructuredText renderer:\n\n- File: `nicegui/elements/restructured_text.py`\n- Function: `prepare_content()`\n\n`prepare_content()` renders user-supplied reStructuredText through Docutils:\n\n```python\nhtml = publish_parts(\n    remove_indentation(content),\n    writer_name='html4',\n    settings_overrides={'syntax_highlight': 'short'},\n)\n```\n\nThe Docutils call only sets `syntax_highlight`. It does not disable file insertion or raw directives, so Docutils processes directives that read local files and embed their contents into the generated HTML before it is returned to the browser. Frontend sanitization cannot prevent this because the file has already been read server-side.\n\nA minimal vulnerable usage pattern is any page that forwards untrusted input into `ui.restructured_text()`, e.g. content taken from query parameters, form fields, or other user-controlled sources.\n\n### Impact\n\nLocal file disclosure. An attacker who can supply reStructuredText content can read files accessible to the NiceGUI server process. Depending on deployment, this may expose:\n\n- application `.env` files\n- database URLs, API tokens, session/storage secrets\n- OAuth or cloud credentials\n- Docker or Kubernetes mounted secrets\n- application source files\n- logs and other process-readable files\n\nThe confirmed impact is confidentiality loss through arbitrary local file read. Applications are only impacted when they pass untrusted or user-controlled reStructuredText into `ui.restructured_text()`.\n\n### Recommended fix\n\nDisable unsafe Docutils features in `prepare_content()`:\n\n```python\nhtml = publish_parts(\n    remove_indentation(content),\n    writer_name='html4',\n    settings_overrides={\n        'syntax_highlight': 'short',\n        'file_insertion_enabled': False,\n        'raw_enabled': False,\n        '_disable_config': True,\n    },\n)\n```\n\nThis blocks the `include`, `csv-table :file:`, and `raw :file:` directives as well as local `docutils.conf` overrides.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nicegui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.12.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.11.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/zauberzeug/nicegui/security/advisories/GHSA-jfrm-rx66-g536"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45553"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/zauberzeug/nicegui"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zauberzeug/nicegui/releases/tag/v3.12.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-18T20:21:59Z",
    "nvd_published_at" : "2026-06-02T16:16:41Z"
  }
}