/

CVE-2026-66881

Severity:

HIGH RISK

(8.1)

Relative Path Traversal (CWE-23) in Livebook Notebooks

CVE-2026-66881

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-23

Impact:

Arbitrary File Write

Severity:

HIGH RISK

(8.1)

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 relative path traversal vulnerability in Livebook allows an attacker-authored notebook to cause attacker-controlled content to be written to an arbitrary filesystem path. The risk arises when a victim opens the notebook and triggers retrieval of a URL-based file entry within an authenticated Livebook session.

Affected context

The vulnerability occurs in Livebook notebook import and file-entry retrieval workflows when a .livemd notebook supplies file_entries metadata. Imported names can bypass the filename validation applied by user-interface-created entries, and URL-type entries may be resolved beneath a temporary session directory without verifying that the final path remains within that directory. The issue is relevant where the Livebook process has write permission to the targeted filesystem location.

Exploit preconditions

  • Attack surface: Livebook notebook import and URL-based file-entry retrieval
  • Required access: No account on the target instance; the attacker must provide a notebook that a victim can open
  • Trigger point: The victim opens the notebook and causes the URL-type file entry to be fetched
  • Why exploitation is possible: Imported entry names are used without the normal flat-filename validation, and path resolution does not enforce containment within the session temporary directory

Why this happens

The underlying bug is insufficient canonical-path validation for attacker-influenced filenames. The import path accepts a file-entry name verbatim, while later resolution collapses parent-directory components without checking that the resulting path remains under the intended temporary directory. This behavior maps to CWE-23: Relative Path Traversal, because untrusted path components can escape an expected directory and direct writes elsewhere on the filesystem.

Potential impact

  • Attacker-controlled content may be written to arbitrary paths the Livebook process can access
  • Sensitive files may be overwritten or corrupted
  • Application behavior or local configuration may be altered
  • The Livebook service may be disrupted
  • Further compromise could occur if a writable target is later executed or trusted by another process

General mitigation guidance

Mitigation generally focuses on treating notebook metadata and URL-derived filenames as untrusted input and enforcing directory containment at the final filesystem operation.

Common defensive patterns include:

  • Accepting only validated, flat filenames for imported file entries
  • Canonicalizing paths and verifying that the resolved destination remains beneath the designated storage directory
  • Rejecting absolute paths, parent-directory segments, and ambiguous path formats
  • Applying the same containment checks to every file-entry creation and attachment path
  • Limiting the Livebook process to the least filesystem privileges required
  • Using isolated, non-sensitive writable directories for fetched content
  • Requiring explicit trust or review before retrieving external notebook resources

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings where user-controlled names reach filesystem path joins or write operations without canonical containment checks
  • Code-review signals involving path normalization that clamps only at the filesystem root rather than an application-owned directory
  • Tests using parent-directory segments, absolute paths, encoded separators, and platform-specific path forms
  • Runtime telemetry showing unexpected writes outside approved Livebook temporary or attachment directories
  • Policy checks requiring canonical-path validation before file creation and restricting external URL retrieval
  • Automated security review tools configured to flag path traversal and arbitrary file-write patterns

Sources

SourceLink
cna.erlef.orgcna.erlef.org/cves/CVE-2026-66881.html
github.comgithub.com/livebook-dev/livebook/commit/1443dd23df6e7b9203b6797f0695a807aeb81dde
github.comgithub.com/livebook-dev/livebook/commit/50f86982ebf36c22abeb379b55ec0f2859c83bb9
github.comgithub.com/livebook-dev/livebook/commit/acf4cb8c0c79b89c795b180f061be7de2d8b5aa9
github.comgithub.com/livebook-dev/livebook/security/advisories/GHSA-r4h8-2xpq-v48g
osv.devosv.dev/vulnerability/EEF-CVE-2026-66881

Frequently asked

questions

The attacker does not need an account on the target Livebook instance, but exploitation generally depends on a victim opening the attacker-supplied notebook and triggering the file-entry fetch.

The attacker needs a way to deliver or host a crafted notebook that the victim will open. The resulting write occurs using the permissions of the victim's Livebook process.

Validate imported filenames and enforce canonical destination containment immediately before writing, ensuring every resolved path remains inside an approved directory.

Treat notebook metadata and remote resource names as untrusted, test path-handling edge cases, isolate writable storage, and run the service with minimal filesystem privileges.

Find out what's already
exploitable in your codebase.