---
schema_version: '1.0'
id: security-20260812-c191f2
title: 'CVE-2026-45553: NiceGUI: Local file disclosure via Docutils file insertion
  in ui.restructured_text()'
url: https://osv.dev/vulnerability/PYSEC-2026-2679
url_hash: c191f20624584208695b29a24ede9e6e385a0804c248e41187148db4005b58f3
canonical_url: https://osv.dev/vulnerability/PYSEC-2026-2679
source: osv:pypa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-45553
- PYSEC-2026-2679
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- nicegui
- PyPI
lang: en
published_at: '2026-07-13T15:19:08Z'
fetched_at: '2026-08-12T16:00:04.521677Z'
updated_at: '2026-08-22T14:45:12Z'
status: published
content_hash: b175e3db1d40f2717abaf7b156ade8538bc81087914ec2c7d13eb3c5ccfb3084
content_changed_at: '2026-08-22T13:15:21.608870Z'
license_note: full
summary: 'NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()'
summary_source: rss
summary_en: 'NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()'
summary_omitted_reason: null
redistribution: true
keywords_en:
- CVE
- CVE-2026-45553
- disclosure
- Docutils
- file
- insertion
- library vulnerability
- Local
- nicegui
- PyPI
- PYSEC-2026-2679
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- software security
- ui.restructured_text
- via
- Work Profile
entities_en:
- name: CVE
  type: data
- name: PyPI
  type: artifact
- name: Work Profile
  type: concept
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: PyPI
  type: artifact
- name: Work Profile
  type: concept
related_auto:
- name: Portal
  type: organization
  weight: 1.0
- name: Hugging Face
  type: organization
  weight: 1.0
computed_at: '2026-08-22T14:45:07Z'
---

# CVE-2026-45553: NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()

## TL;DR
NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()

## Key Points
- cve / CVE-2026-45553 / PYSEC-2026-2679 / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N / nicegui / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
**Advisory:** PYSEC-2026-2679 (CVE-2026-45553)

**Details:**
### 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.

**References:**
- https://github.com/zauberzeug/nicegui/security/advisories/GHSA-jfrm-rx66-g536
- https://nvd.nist.gov/vuln/detail/CVE-2026-45553
- https://github.com/zauberzeug/nicegui
- https://github.com/zauberzeug/nicegui/releases/tag/v3.12.0
- https://pypi.org/project/nicegui
- https://github.com/advisories/GHSA-jfrm-rx66-g536

_Data: OSV.dev (upstream: pypa) — https://osv.dev/vulnerability/PYSEC-2026-2679_

## Source
元記事: [CVE-2026-45553: NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()](https://osv.dev/vulnerability/PYSEC-2026-2679) — published 2026-07-13T15:19:08Z
