CVE-2026-86258: nbviewer: path traversal leaks notebooks/credentials
MEDIUMnbviewer's LocalFileHandler decides which files it is allowed to serve using a simple string-prefix check instead of real path validation, so a sibling directory whose name merely starts with the configured root's text (e.g. "notebooks-internal" vs root "notebooks") is treated as in-bounds and its contents get served. This matters because nbviewer is commonly self-hosted to share Jupyter notebooks internally, and those notebooks routinely contain hardcoded API keys, database credentials, or unpublished research data that was never meant to leave its own folder. There's no CISA KEV listing, no EPSS score, and no public exploit or Nuclei template yet, and the CVSS AC:H reflects that an attacker needs to guess or enumerate sibling directory names — so this is not an actively-exploited, drop-everything bug, but it is trivial to weaponize once a target's directory layout is known. Patch to the fixed release once available (track commit aad3610 on the nbviewer repo) or apply the upstream path-validation fix directly; in the meantime, isolate each nbviewer root in its own dedicated parent directory with no sensitive siblings, and audit any internet- or intranet-facing nbviewer instance for notebooks containing credentials so they can be rotated.
What is the risk?
Medium severity (CVSS 5.9, confidentiality-only impact) but with real-world blast radius higher than the score suggests: internal notebook-sharing setups frequently place multiple project directories under a shared parent, which is exactly the pattern this bug exploits. Attack complexity is high because the adversary must know or brute-force a sibling directory name that shares the configured root as a text prefix, and exploitation requires no authentication or user interaction (PR:N, UI:N) over the network. No evidence of active exploitation, no KEV entry, and no EPSS/public PoC currently exist, so near-term opportunistic exploitation risk is low — but the flaw is simple enough (a naive `startswith()`-style check) that a working exploit could appear quickly once researchers or attackers look for it.
How does the attack unfold?
How severe is it?
What is the attack surface?
What should I do?
1 step-
1) Upgrade nbviewer past 1.0.1 once a fixed release is published, or backport the upstream fix from commit aad3610 (proper path resolution/containment check) if running from source. 2) As an immediate workaround, ensure the configured notebook root has no sibling directories at all (place it as the sole child of its parent, or run nbviewer inside a container/chroot scoped only to that directory). 3) Audit existing nbviewer deployments' file trees for credentials or secrets embedded in notebooks and rotate any that could have been exposed. 4) Add access-log monitoring for requests referencing directory names that are textual extensions of the configured root (e.g. root+suffix patterns) to detect exploitation attempts. 5) Where possible, put nbviewer behind authentication/network restrictions rather than relying on path scoping alone.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-86258?
nbviewer's LocalFileHandler decides which files it is allowed to serve using a simple string-prefix check instead of real path validation, so a sibling directory whose name merely starts with the configured root's text (e.g. "notebooks-internal" vs root "notebooks") is treated as in-bounds and its contents get served. This matters because nbviewer is commonly self-hosted to share Jupyter notebooks internally, and those notebooks routinely contain hardcoded API keys, database credentials, or unpublished research data that was never meant to leave its own folder. There's no CISA KEV listing, no EPSS score, and no public exploit or Nuclei template yet, and the CVSS AC:H reflects that an attacker needs to guess or enumerate sibling directory names — so this is not an actively-exploited, drop-everything bug, but it is trivial to weaponize once a target's directory layout is known. Patch to the fixed release once available (track commit aad3610 on the nbviewer repo) or apply the upstream path-validation fix directly; in the meantime, isolate each nbviewer root in its own dedicated parent directory with no sensitive siblings, and audit any internet- or intranet-facing nbviewer instance for notebooks containing credentials so they can be rotated.
Is CVE-2026-86258 actively exploited?
No confirmed active exploitation of CVE-2026-86258 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-86258?
1) Upgrade nbviewer past 1.0.1 once a fixed release is published, or backport the upstream fix from commit aad3610 (proper path resolution/containment check) if running from source. 2) As an immediate workaround, ensure the configured notebook root has no sibling directories at all (place it as the sole child of its parent, or run nbviewer inside a container/chroot scoped only to that directory). 3) Audit existing nbviewer deployments' file trees for credentials or secrets embedded in notebooks and rotate any that could have been exposed. 4) Add access-log monitoring for requests referencing directory names that are textual extensions of the configured root (e.g. root+suffix patterns) to detect exploitation attempts. 5) Where possible, put nbviewer behind authentication/network restrictions rather than relying on path scoping alone.
What systems are affected by CVE-2026-86258?
This vulnerability affects the following AI/ML architecture patterns: notebook sharing/rendering platforms, internal MLOps documentation portals, research collaboration tooling.
What is the CVSS score for CVE-2026-86258?
CVE-2026-86258 has a CVSS v3.1 base score of 5.9 (MEDIUM). The EPSS exploitation probability is 0.36%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0037 Data from Local System AML.T0055 Unsecured Credentials Compliance Controls Affected
What are the technical details?
Original Advisory
nbviewer through 1.0.1 contains a path traversal vulnerability in LocalFileHandler.can_show() that uses string-prefix comparison instead of proper path validation. Attackers can read files from sibling directories outside the configured root by requesting paths that share the root as a textual prefix, disclosing unintended notebooks and credentials.
Exploitation Scenario
An internal ML team hosts nbviewer at notebooks.internal.example.com, configured to serve files from /data/notebooks-public. A separate, unlisted directory /data/notebooks-public-drafts sits alongside it and contains draft notebooks with hardcoded cloud API keys and a database connection string used for a RAG pipeline. An attacker (or a curious insider) requests a path like /view/notebooks-public-drafts/config.ipynb; because can_show() only checks that the requested path starts with the string "notebooks-public", the check passes even though notebooks-public-drafts is a distinct, unintended directory. nbviewer serves the file, and the attacker extracts the embedded credentials to pivot into the team's data infrastructure.
Weaknesses (CWE)
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Primary
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') CWE-22 — Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'): The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
- [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
- [Architecture and Design] For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N References
- github.com/jupyter/nbviewer
- github.com/jupyter/nbviewer/blob/1.0.1/nbviewer/providers/local/handlers.py
- github.com/jupyter/nbviewer/commit/aad36106f72a1ca7721310c6fccc677ce4c744a5
- github.com/jupyter/nbviewer/issues/1115
- vulncheck.com/advisories/nbviewer-through-1.0.1-path-traversal-via-localfilehandler
Timeline
Related Vulnerabilities
CVE-2025-5120 10.0 smolagents: sandbox escape enables unauthenticated RCE
Same attack type: Data Leakage CVE-2023-3765 10.0 MLflow: path traversal allows arbitrary file read
Same attack type: Data Leakage CVE-2025-2828 10.0 LangChain RequestsToolkit: SSRF exposes cloud metadata
Same attack type: Auth Bypass CVE-2025-53767 10.0 Azure OpenAI: SSRF EoP, no auth required (CVSS 10)
Same attack type: Auth Bypass CVE-2026-21858 10.0 n8n: Input Validation flaw enables exploitation
Same attack type: Auth Bypass