Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
PYSEC-2026-1691
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
LoadLibraryorLoadLibraryExfunction 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.
-
Create a directory containing:
-
A hidden bat file called
inkscape.batcontainingmsg * "You've been hacked!" -
A dummy ipynb file called
Machine_Learning.ipynb
-
-
Run the command
jupyter nbconvert --to pdf Machine_Learning.ipynb. -
Wait a few seconds, and you should see a popup showing the message "You've been hacked!"
Impact
All Windows users.
The vulnerability requires local access to the device to be exploited. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights.
Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard