/

CVE-2026-35397

Severity:

HIGH RISK

(8.8)

Path Traversal in Jupyter Server REST API contents Handling

CVE-2026-35397

Modified

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File System Access and Modification

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal flaw in the Jupyter Server REST API allows authenticated users to escape the configured root_dir and access sibling directories whose names share the same prefix as the root directory.

By crafting encoded paths to the /api/contents endpoint, an attacker can read, write, and delete files in other users' directories in multi-tenant or shared deployments.

Affected context

This vulnerability affects Jupyter Server deployments that:

  • Use the /api/contents REST API for file operations
  • Rely on root_dir to isolate user or tenant workspaces
  • Have sibling directories that share a common prefix with the configured root_dir

It is particularly relevant in multi-tenant environments where per-user directories follow predictable naming schemes (e.g., user1, user10, user11) and where authenticated users are expected to be confined to their own directory subtree.

Exploit preconditions

  • Attack surface: Jupyter Server REST API endpoint /api/contents
  • Required access: Valid authenticated access to Jupyter Server with permission to use the contents API
  • Deployment assumptions: The server is configured with a root_dir intended to restrict each user to a specific directory subtree, and sibling directories exist that share a prefix with that root directory name
  • Trigger point: Submission of a crafted request to /api/contents using encoded path components that exploit traversal logic and prefix-matching behavior
  • Why exploitation is possible: The input path normalization and validation logic insufficiently constrains resolved paths to the configured root_dir, allowing traversal into sibling directories whose names begin with the same prefix, despite directory isolation expectations.

Why this happens

The underlying issue stems from incorrect canonicalization and validation of file system paths that are derived from user-controlled input.

Instead of strictly enforcing that all resolved paths remain within the configured root_dir, the implementation relies on logic that can be bypassed when sibling directories share a common prefix with root_dir.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where path traversal is possible because the application does not robustly verify that normalized paths do not escape the intended directory boundary.

Encoded path components and prefix-based checks combine to create a situation where users confined to one directory can interact with files located in other, similarly named sibling directories.

Potential impact

  • Unauthorized reading of files in sibling directories that share a prefix with the configured root_dir
  • Unauthorized modification or overwriting of files belonging to other users or tenants
  • Deletion of critical or user-owned data in neighboring directories
  • Breach of data isolation guarantees in multi-tenant Jupyter environments
  • Potential exposure of configuration files or secrets stored in affected sibling directories, depending on deployment layout

General mitigation guidance

Mitigation typically focuses on enforcing strict directory boundaries and hardening path handling:

  • Implement robust canonicalization of all user-supplied paths and verify that the final, normalized path resides strictly within the configured root_dir (e.g., by comparing absolute paths rather than relying on string prefixes).
  • Avoid prefix-based directory isolation; instead, treat root_dir as an absolute boundary and reject any requests that resolve outside of it.
  • Use per-tenant or per-user directory layouts that do not rely solely on predictable, prefix-based naming schemes; consider hierarchical structures that naturally segregate tenants.
  • Reduce filesystem privileges for the Jupyter Server process so it only has access to directories that are legitimately needed for each instance.
  • Apply defense-in-depth by separating tenants at the operating-system or container level, limiting the impact of any path validation flaw in a single server instance.

How teams detect issues like this

Detection can leverage both code-centric and operational approaches:

  • Static analysis: Look for file operations in the Jupyter Server codebase (or similar systems) where user-controlled paths are joined with a base directory using string operations or incomplete normalization checks; flag locations that do not verify that the resolved path remains within the intended root.
  • Code review signals: Pay attention to any logic that relies on prefix matching, partial string comparison, or manual path concatenation for directory isolation; ensure reviewers verify correct use of canonicalized absolute paths.
  • Runtime monitoring: Instrument logging around the /api/contents endpoint to record requested paths and the final resolved filesystem paths; alert on accesses that target directories outside expected user roots or that follow unusual encoded patterns.
  • Policy enforcement: Integrate security linting and configuration checks into CI/CD pipelines to ensure new code paths respect directory boundaries and that deployments do not co-locate unrelated tenants in sibling directories with overlapping name prefixes.
  • Automated review tools can complement manual review by flagging dangerous path-handling patterns and missing path boundary checks.

Sources

SourceLink
github.comgithub.com/jupyter-server/jupyter_server/security/advisories/GHSA-5789-5fc7-67v3
access.redhat.comaccess.redhat.com/errata/RHSA-2026:43038
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-35397
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2466858
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-35397.json

Frequently asked

questions

Yes. Any user who can authenticate to a vulnerable Jupyter Server instance and invoke the /api/contents endpoint over the network can attempt to exploit the vulnerability, subject to deployment-specific access controls and network exposure.

The attacker must have valid authenticated access to the Jupyter Server with permissions to interact with the contents API (e.g., a normal user account). No additional OS-level privileges are required; the server process performs the file operations on their behalf.

The most reliable fix is to enforce strict path confinement based on canonicalized absolute paths: resolve the requested path, normalize it, and then verify that it is a descendant of the configured root_dir before permitting any file system operation. Any path that resolves outside the root directory should be rejected.

Use well-vetted path-handling utilities, avoid ad-hoc string manipulations for file paths, and always validate resolved paths against an explicit directory boundary. Combine this with architectural isolation (per-tenant processes or containers) and automated security checks in the development pipeline to catch unsafe path usage early.

Find out what's already
exploitable in your codebase.