Skip to content
HighVulnerability

GHSA-jfrm-rx66-g536: NiceGUI: Local file disclosure via Docutils file insertion in ui.restructured_text()

Published
Record updated
View JSON
Affected
  • nicegui <= 3.11.1
Fixed in
3.12.0
  • released May 12, 2026, 6 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.3%

Summary

NiceGUI's `ui.restructured_text()` renders reStructuredText through Docutils in `prepare_content()` in `nicegui/elements/restructured_text.py` without disabling file insertion or raw directives. An attacker who supplies content to the function can use `include`, `csv-table` with `:file:`, or `raw` with `:file:` to read files readable by the NiceGUI server process, such as `.env` files and mounted secrets. Applications that pass only trusted static strings are not affected.

Mitigation

Disable unsafe Docutils features in `prepare_content()` by setting `file_insertion_enabled` to False, `raw_enabled` to False, and `_disable_config` to True in `settings_overrides`, alongside the existing `syntax_highlight: 'short'`. This blocks the `include`, `csv-table :file:`, and `raw :file:` directives and local `docutils.conf` overrides.