CVE-2026-66881: Path traversal in imported file_entries name allows arbitrary file write via URL-type entry download
Summary
Relative Path Traversal vulnerability in livebook-dev livebook allows an attacker-authored notebook to write a file with attacker-controlled content to an arbitrary path.
A .livemd notebook can declare fileentries metadata, each entry carrying a name. Every path that creates a file entry through the user interface validates that name with Livebook.Notebook.validatefileentryname/2, which requires a flat filename of alphanumerics, dashes, underscores and dots, ending in an extension. The import path does not: Livebook.LiveMarkdown.Import.fileentrymetadatatoattrs/1 in lib/livebook/livemarkdown/import.ex takes the name verbatim from the notebook source.
For a URL-type file entry, Livebook.Session.fileentrycachefile/2 in lib/livebook/session.ex resolves that name beneath the session's temporary directory without checking that the result stays inside it, and Livebook.FileSystem.Utils.resolveunixlikepath/2 collapses parent-directory segments while clamping only at the filesystem root. When the entry's content is requested and no cached copy exists, Livebook fetches the entry's URL and writes the response body to the resolved path, creating parent directories as needed. The attacker therefore controls both the destination and the contents of the written file, which may land anywhere the Livebook process can write. The same missing containment check is present in Livebook.Session.toattachmentfileentry/2.
A victim who opens an attacker-supplied notebook and causes the entry to be fetched triggers the write within their own authenticated session; the attacker needs no account on the target instance. URL-type entries are also not placed under notebook stamping quarantine on import, so no warning is shown.
This issue affects livebook: from 0.11.0 before 0.18.7 and from 0.19.0 before 0.19.9.
Other sources
Relative Path Traversal vulnerability in livebook-dev livebook allows an attacker-authored notebook to write a file with attacker-controlled content to an arbitrary path.
A .livemd notebook can declare fileentries metadata, each entry carrying a name. Every path that creates a file entry through the user interface validates that name with Livebook.Notebook.validatefileentryname/2, which requires a flat filename of alphanumerics, dashes, underscores and dots, ending in an extension. The import path does not: Livebook.LiveMarkdown.Import.fileentrymetadatatoattrs/1 in lib/livebook/livemarkdown/import.ex takes the name verbatim from the notebook source.
For a URL-type file entry, Livebook.Session.fileentrycachefile/2 in lib/livebook/session.ex resolves that name beneath the session's temporary directory without checking that the result stays inside it, and Livebook.FileSystem.Utils.resolveunixlikepath/2 collapses parent-directory segments while clamping only at the filesystem root. When the entry's content is requested and no cached copy exists, Livebook fetches the entry's URL and writes the response body to the resolved path, creating parent directories as needed. The attacker therefore controls both the destination and the contents of the written file, which may land anywhere the Livebook process can write. The same missing containment check is present in Livebook.Session.toattachmentfileentry/2.
A victim who opens an attacker-supplied notebook and causes the entry to be fetched triggers the write within their own authenticated session; the attacker needs no account on the target instance. URL-type entries are also not placed under notebook stamping quarantine on import, so no warning is shown.
This issue affects livebook: from 0.11.0 before 0.18.7 and from 0.19.0 before 0.19.9.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
erlang/livebookto a version that resolves this vulnerability.Fixed in 0.18.7 - Upgrade
Upgrade
erlang/livebookto a version that resolves this vulnerability.Fixed in 0.19.9 - Upgrade
Upgrade
livebookto a version that resolves this vulnerability.Fixed in 0.18.7 - Upgrade
Upgrade
livebookto a version that resolves this vulnerability.Fixed in 0.19.9
Event History
Frequently Asked Questions
What is the severity of CVE-2026-66881?
CVE-2026-66881 has a risk rating of 71, indicating a high severity level.
What type of vulnerability is CVE-2026-66881?
CVE-2026-66881 is classified as a Path Traversal vulnerability.
How can CVE-2026-66881 be exploited?
CVE-2026-66881 can be exploited by manipulating the name in imported file entries to write files to arbitrary paths.
How do I mitigate CVE-2026-66881?
To mitigate CVE-2026-66881, ensure that imported file entry names are validated and sanitized to prevent path traversal.
Who is affected by CVE-2026-66881?
CVE-2026-66881 affects users of the livebook-dev livebook application that allows importing notebooks with file entries.