GHSA-pjvx-prjx-h659

Suggest an improvement
Source
https://github.com/advisories/GHSA-pjvx-prjx-h659
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-pjvx-prjx-h659/GHSA-pjvx-prjx-h659.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-pjvx-prjx-h659
Aliases
Published
2026-10-22T16:23:28Z
Modified
2026-10-22T16:30:41Z
Severity
  • 8.8 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H CVSS Calculator
Summary
nbconvert: Arbitrary file write through path traversal in cell output filenames when exporting to md, latex, rst and asciidoc
Details

Summary

nbconvert <= v7.17.1 has an arbitrary file write vulnerability due to a path traversal in ipynb cell output metadata, more specifically on the filename attribute.

Vulnerable converters : --to markdown, --to latex, --to rst, --to asciidoc.

In ExtractOutputPreprocessor, extractoutput.py:116-119 joins attacker-controlled path to output_files_dir with no canonicalization check, enabling arbitrary file write.

This is a sibling vulnerability of https://github.com/advisories/GHSA-4c99-qj7h-p3vg.

Impact

If a victim runs nbconvert on a malicious ipynb file, it can create some files with arbitrary data in arbitrary locations, i.e. override authorized_keys.

Note that running the cell with jupyter overrides the output, so it would "clean up" malicious cells.

PoC

In a ipynb file:


"cells": [{
        "cell_type": "code", "id": "abc123", "execution_count": 1,
        "metadata": {}, "source": "# PoC",
        "outputs": [{
            "output_type": "display_data",
            "metadata": {
                "filename": "../../../tmp/PWNED.png"  # ← traverses outside output_dir
            },
            "data": {
                # minimal valid PNG (1×1 pixel)
                "image/png": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
            }
        }]
    }]

Patches

Fixed in

Database specific
{
    "cwe_ids":  [
        "CWE-22"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-10-22T16:23:28Z",
    "nvd_published_at":  "2026-10-21T21:17:56Z",
    "severity":  "HIGH"
}
References

Affected packages

PyPI / nbconvert

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.4.0
Fixed
7.17.2

Affected versions

5.*
5.4.0
5.4.1.dev0
5.4.1
5.5.0
5.6.0
5.6.1
6.*
6.0.0a0
6.0.0a1
6.0.0a2
6.0.0a3
6.0.0a4
6.0.0a5
6.0.0a6
6.0.0b7
6.0.0rc0
6.0.0
6.0.1
6.0.2
6.0.3
6.0.4
6.0.5
6.0.6
6.0.7
6.1.0rc0
6.1.0
6.1.1b0
6.2.0rc0
6.2.0rc1
6.2.0rc2
6.2.0
6.3.0b0
6.3.0
6.4.0
6.4.1
6.4.2
6.4.3
6.4.4
6.4.5
6.5.0
6.5.1
6.5.2
6.5.3
6.5.4
7.*
7.0.0rc0
7.0.0rc1
7.0.0rc2
7.0.0rc3
7.0.0
7.1.0
7.2.0
7.2.1
7.2.2
7.2.3
7.2.4
7.2.5
7.2.6
7.2.7
7.2.8
7.2.9
7.2.10
7.3.0
7.3.1
7.4.0
7.5.0
7.6.0
7.7.0
7.7.1
7.7.2
7.7.3
7.7.4
7.8.0
7.9.0
7.9.1
7.9.2
7.10.0
7.11.0
7.12.0
7.13.0
7.13.1
7.14.0
7.14.1
7.14.2
7.15.0
7.16.0
7.16.1
7.16.2
7.16.3
7.16.4
7.16.5
7.16.6
7.17.0
7.17.1

Database specific

last_known_affected_version_range
"<= 7.17.1"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-pjvx-prjx-h659/GHSA-pjvx-prjx-h659.json"