nbconvert allows arbitrary file writes to locations outside the intended output directory when processing notebooks containing crafted cell attachment filenames. The ExtractAttachmentsPreprocessor passes attachment filenames directly to the filesystem without sanitization, enabling path traversal attacks. This vulnerability provides complete control over both the destination path and file extension.
This vulnerability allows writing files with arbitrary content to arbitrary filesystem locations, limited only by the permissions of the process running nbconvert. The attacker controls:
../ traversal)disable ExtractAttachmentsPreprocessor by setting:
c. ExtractAttachmentsPreprocessor.enabled = False
{
"cwe_ids": [
"CWE-22",
"CWE-73"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-21T17:18:18Z",
"nvd_published_at": "2026-04-21T01:16:05Z",
"severity": "MODERATE"
}