Skip to main content

CVE-2026-108258: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in posit-dev py-shiny

0
Medium
Published: 10/09/2026 (10/09/2026, 20:56:37 UTC)
Source: CVE Database V5
Vendor/Project: posit-dev
Product: py-shiny

Description

### Impact Shiny for Python's bookmark-restore path accepted a client-supplied `_state_id_` query-string value and joined it into the server-side bookmark directory (`<cwd>/shiny_bookmarks/<id>`) without validating it. A value containing `..` path segments, or an absolute path, could therefore cause the server to open and parse `input.json` and `values.json` from a directory outside the bookmark store. On a default application the restore was attempted whenever the client supplied a URL query string — including when bookmarking was disabled (`bookmark_store="disable"`) — so no opt-in configuration was required. For such applications the impact is an unauthenticated, server-side probe for the existence and JSON-validity of attacker-chosen paths, constrained to those two file names. Applications configured with `bookmark_store="server"` **and** using `ui.input_file()` are affected more seriously. The file-input restore handler copies files out of the restore directory, so the contents of an attacker-selected file name within an attacker-selected directory could be read into the application. ### Affected versions 1.4.0 through 1.6.3. Bookmarking was introduced in 1.4.0; earlier releases do not contain the affected code path and are not affected. ### Patches Fixed in **1.6.4**. Upgrade with: ``` pip install --upgrade shiny ``` The fix validates bookmark IDs against an allowlist — a single path segment matching `[A-Za-z0-9_-]+`, which cannot express a path separator, a `..` parent reference, or an absolute path — before the ID is used to build a filesystem path. Bookmark IDs generated by Shiny are unaffected by this restriction. Restore is additionally gated on the application's `bookmark_store` setting at a single point, so it no longer runs when bookmarking is disabled, and the on-disk restore path is honored only under `bookmark_store="server"`. ### Workarounds There is no configuration change that mitigates this on an affected version: the restore path ran even with `bookmark_store="disable"`. Deployments that cannot upgrade immediately can strip the `_state_id_` parameter from incoming query strings at a reverse proxy or load balancer, which prevents the affected code path from being reached. ### Credits Reported by [@0xRenSec](https://github.com/0xRenSec).

CVSS v4.0

Score 6.9medium

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
Low
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Affected software

posit-dev

py-shiny

Affected versions
>=1.4.0 <1.6.4
py-shiny
pkg:pypi/py-shiny
Affected versions
>=1.4.0 <1.6.4

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/09/2026, 21:03:16 UTC

Technical Analysis

py-shiny versions >=1.4.0 and <1.6.4 contain a CWE-22 path traversal vulnerability in the bookmark restore feature. The vulnerability arises because the server accepts a client-supplied state_id and concatenates it into the shiny_bookmarks directory path without validating that it is a safe single path segment. This allows unauthenticated attackers to use parent-directory references or absolute paths to access files outside the bookmark store directory. When bookmark_store is set to server and ui.input_file() is used, the restore handler can copy and expose arbitrary files from attacker-controlled directories. The vulnerability is resolved in version 1.6.4.

Potential Impact

An unauthenticated attacker can exploit this vulnerability to read arbitrary files on the server by traversing directories outside the intended bookmark storage location. This can lead to exposure of sensitive files such as input.json and values.json. In certain configurations, attackers can also copy and expose files from arbitrary directories, potentially leading to information disclosure. The CVSS 4.0 base score is 6.9 (medium severity), reflecting network attack vector, low complexity, no privileges or user interaction required, and limited confidentiality impact.

Mitigation Recommendations

Upgrade py-shiny to version 1.6.4 or later, where this path traversal vulnerability is fixed. No other mitigations are indicated or required according to the available data.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-10-09T17:33:15.409Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6ac9533c2cdf04f65682285f

Added to database: 10/09/2026, 20:49:00 UTC

Last enriched: 10/09/2026, 21:03:16 UTC

Last updated: 10/09/2026, 22:44:17 UTC

Views: 11

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses