Skip to main content
Vulnerability Database/CVE-2026-108258

CVE-2026-108258: Shiny for Python Path Traversal Vulnerability

CVE-2026-108258 is a path traversal flaw in Shiny for Python that allows unauthenticated attackers to access files outside the bookmark store. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-108258 Overview

CVE-2026-108258 is a path traversal vulnerability [CWE-22] in Shiny for Python, a framework for building interactive web applications in Python. The flaw affects versions 1.4.0 through 1.6.3. The bookmark restore handler accepts a client-supplied state_id and joins it into the server-side shiny_bookmarks directory without validating that it is a single safe path segment. An unauthenticated attacker can use parent-directory traversal segments or an absolute path to read input.json and values.json outside the bookmark store. The issue is fixed in version 1.6.4.

Critical Impact

Unauthenticated remote attackers can read arbitrary files outside the bookmark directory, and when bookmark_store is set to server with ui.input_file(), can cause the restore handler to copy and expose attacker-selected files from attacker-selected directories.

Affected Products

  • Shiny for Python (py-shiny) versions 1.4.0 through 1.6.3
  • Applications using bookmark_store set to server with ui.input_file() (elevated impact)
  • Applications configured with bookmark_store set to disable (still vulnerable to path traversal reads)

Discovery Timeline

  • 2026-10-09 - CVE CVE-2026-108258 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-108258

Vulnerability Analysis

Shiny for Python supports bookmarkable application state through a RestoreContext constructed from query-string parameters. The server derives a filesystem location by joining a client-supplied state_id into the shiny_bookmarks directory. Because the handler does not validate that state_id is a single safe path segment, attackers can submit values containing ../ sequences or absolute paths. The server resolves these to locations outside the bookmark store and opens input.json and values.json from the attacker-chosen directory. The request requires no authentication.

Root Cause

The root cause is missing path segment validation in the bookmark restore code path. The pre-patch _app.py logic only skipped RestoreContext.from_query_string when bookmark_store == "disable", but the path join itself trusted the client-supplied identifier. Additionally, the restore error handler echoed resolved server paths back to the client through user-facing notifications, aiding exploitation and reconnaissance.

Attack Vector

An unauthenticated attacker crafts an HTTP request to the Shiny app with a malicious state_id query parameter containing traversal segments or an absolute path. The server opens files at the attacker-chosen location. In applications using bookmark_store = "server" combined with ui.input_file(), the restore handler additionally copies the attacker-selected file into the session file-input area, exposing its contents through the application UI.

python
         request for / occurs.
         """
         ui: RenderedHTML
-        if self.bookmark_store == "disable":
-            restore_ctx = RestoreContext()
-        else:
-            restore_ctx = await RestoreContext.from_query_string(
-                request.url.query, app=self
-            )
+        restore_ctx = await RestoreContext.from_query_string(
+            request.url.query, app=self
+        )

         if callable(self.ui):
             # At this point, if `app.bookmark_store != "disable"`, then we've already

Source: GitHub Commit 1d8ecb4 – shiny/_app.py

The second patch hunk sanitizes the restore error notification shown to clients, replacing echoed server-side detail with a generic message to prevent information disclosure during exploitation attempts:

python
             @otel_suppress
             def init_error_message():
                 if self._restore_context and self._restore_context._init_error_msg:
+                    # Keep the detail server-side (it is logged by
+                    # `RestoreContext.from_query_string`): the message can echo
+                    # client-supplied input and resolved server paths.
                     notification_show(
-                        f"Error in RestoreContext initialization: {self._restore_context._init_error_msg}",
+                        "Error restoring bookmarked state.",
                         duration=None,
                         type="error",
                         session=root_session,

Source: GitHub Commit 1d8ecb4 – shiny/bookmark/_bookmark.py

Detection Methods for CVE-2026-108258

Indicators of Compromise

  • HTTP requests to Shiny app endpoints containing a _state_id_ query parameter with ../, ..\, URL-encoded traversal sequences (%2e%2e%2f), or absolute filesystem paths.
  • Application logs showing RestoreContext initialization errors referencing paths outside the configured shiny_bookmarks directory.
  • Unexpected read access on sensitive files (for example /etc/passwd, application secrets) by the Shiny process user.
  • Spikes in bookmark restore requests from a single client without a prior bookmark-save event.

Detection Strategies

  • Inspect reverse-proxy and application logs for query strings containing _state_id_ values that are not opaque single segments.
  • Alert on file-read events from the Shiny process targeting paths outside the application working directory.
  • Correlate failed restore attempts with subsequent anomalous file-input content in ui.input_file()-enabled sessions.

Monitoring Recommendations

  • Enable verbose logging of bookmark restore operations and ship logs to a central analytics platform.
  • Monitor the Python package inventory for installations of shiny versions below 1.6.4.
  • Baseline normal bookmark URL patterns and alert on deviations containing path-manipulation characters.

How to Mitigate CVE-2026-108258

Immediate Actions Required

  • Upgrade shiny (py-shiny) to version 1.6.4 or later across all deployed applications.
  • Audit internet-exposed Shiny apps for prior exploitation by reviewing access logs for suspicious _state_id_ values.
  • Restrict filesystem permissions of the Shiny process user to the minimum required paths.
  • Place Shiny apps behind a web application firewall (WAF) that blocks path-traversal payloads in query strings.

Patch Information

The fix is included in py-shiny Release v1.6.4. Technical details are documented in GitHub Security Advisory GHSA-47c3-hpmg-7j6p and the fix commit is available at GitHub Commit 1d8ecb4.

Workarounds

  • Setting bookmark_store to disable does not fully mitigate; upgrading remains required.
  • Deploy a reverse-proxy rule that rejects requests whose _state_id_ query parameter contains .., /, \, or URL-encoded equivalents.
  • Run the Shiny process as an unprivileged user chrooted or containerized to a minimal directory tree.
bash
# Upgrade py-shiny to the patched release
pip install --upgrade 'shiny>=1.6.4'

# Verify installed version
python -c "import shiny; print(shiny.__version__)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.