High

nbconvert has an uncontrolled search path that leads to unauthorized code execution on Windows

  • Disclosed: 18.12.2025
  • Updated: 11.10.2026 15:17

Summary

On Windows, converting a notebook containing SVG output to a PDF results in unauthorized code execution. Specifically, a third party can create a inkscape.bat file that defines a Windows batch script, capable of arbitrary code execution.

When a user runs jupyter nbconvert --to pdf on a notebook containing SVG output to a PDF on a Windows platform from this directory, the inkscape.bat file is run unexpectedly.

Details

Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer.

nbconvert searches for an inkscape executable when converting notebooks to PDFs here: https://github.com/jupyter/nbconvert/blob/4f61702f5c7524d8a3c4ac0d5fc33a6ac2fa36a7/nbconvert/preprocessors/svg2pdf.py#L104

The MITRE page on CWE-427 (Uncontrolled Search Path Element) summarizes the root cause succinctly:

In Windows-based systems, when the LoadLibrary or LoadLibraryEx function is called with a DLL name that does not contain a fully qualified path, the function follows a search order that includes two path elements that might be uncontrolled:

  • the directory from which the program has been loaded
  • the current working directory

PoC

Complete instructions, including specific configuration details, to reproduce the vulnerability.

  1. Create a directory containing:

    • A hidden bat file called inkscape.bat containing msg * "You've been hacked!"

    • A dummy ipynb file called Machine_Learning.ipynb

  2. Run the command jupyter nbconvert --to pdf Machine_Learning.ipynb.

  3. Wait a few seconds, and you should see a popup showing the message "You've been hacked!"

Impact

All Windows users.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) nbconvert < 7.17.0 7.17.0

References

CVSS score -
CVSS vector
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Weakness (CWE)
CWE-427
Platform
Python (PyPI)
Package
nbconvert
Disclosed
18.12.2025
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-1691 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-xm59-rqc7-hhvf - CC BY 4.0

Vulnerability history: nbconvert

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
4
First → latest
08.2022 04.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 3

Disclosures per year

  1. 2022: 1
  2. 2023: 0
  3. 2024: 0
  4. 2025: 1
  5. 2026: 2
  1. Medium · 6.5 CVE-2026-39377 >= 6.5.0, < 7.17.1 7.17.1
  2. nbconvert has an uncontrolled search path that leads to unauthorized code execution on Windows this entry
    High CVE-2025-53000 < 7.17.0 7.17.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.