{"id":"PYSEC-2026-1691","summary":"nbconvert has an uncontrolled search path that leads to unauthorized code execution on Windows","details":"### Summary\n\nOn 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](https://en.wikipedia.org/wiki/Batch_file), capable of arbitrary code execution.\n\nWhen 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.\n\n### Details\n_Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._\n\n`nbconvert` searches for an `inkscape` executable when converting notebooks to PDFs here: https://github.com/jupyter/nbconvert/blob/4f61702f5c7524d8a3c4ac0d5fc33a6ac2fa36a7/nbconvert/preprocessors/svg2pdf.py#L104\n\nThe MITRE page on [CWE-427 (Uncontrolled Search Path Element)](https://cwe.mitre.org/data/definitions/427.html) summarizes the root cause succinctly:\n\n\u003e 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:\n\u003e - the directory from which the program has been loaded\n\u003e - the current working directory\n\n### PoC\n\n_Complete instructions, including specific configuration details, to reproduce the vulnerability._\n\n1. Create a directory containing: \n\n    - A hidden bat file called `inkscape.bat` containing `msg * \"You've been hacked!\"`\n\n    - A dummy ipynb file called `Machine_Learning.ipynb`\n\n2. Run the command `jupyter nbconvert --to pdf Machine_Learning.ipynb`.\n\n3. Wait a few seconds, and you should see a popup showing the message \"You've been hacked!\" \n\n### Impact\n\nAll Windows users.","aliases":["CVE-2025-53000","GHSA-xm59-rqc7-hhvf"],"modified":"2026-07-07T17:47:07.138450304Z","published":"2026-07-07T16:03:13.458953Z","references":[{"type":"WEB","url":"https://github.com/jupyter/nbconvert/security/advisories/GHSA-xm59-rqc7-hhvf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-53000"},{"type":"WEB","url":"https://github.com/jupyter/nbconvert/issues/2258"},{"type":"WEB","url":"https://github.com/jupyter/nbconvert/commit/c9ac1d1040459ed1ff9eb34e9918ce5a87cf9d71"},{"type":"PACKAGE","url":"https://github.com/jupyter/nbconvert"},{"type":"WEB","url":"https://github.com/jupyter/nbconvert/blob/4f61702f5c7524d8a3c4ac0d5fc33a6ac2fa36a7/nbconvert/preprocessors/svg2pdf.py#L104"},{"type":"WEB","url":"https://github.com/jupyter/nbconvert/releases/tag/v7.17.0"},{"type":"WEB","url":"https://www.imperva.com/blog/code-execution-in-jupyter-notebook-exports"},{"type":"PACKAGE","url":"https://pypi.org/project/nbconvert"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-xm59-rqc7-hhvf"}],"affected":[{"package":{"name":"nbconvert","ecosystem":"PyPI","purl":"pkg:pypi/nbconvert"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"7.17.0"}]}],"versions":["0.0.0","4.0.0","4.1.0","4.2.0","4.3.0","5.0.0","5.0.0b1","5.1.0","5.1.1","5.2.1","5.3.0","5.3.1","5.4.0","5.4.1","5.4.1.dev0","5.5.0","5.6.0","5.6.1","6.0.0","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.1","6.0.2","6.0.3","6.0.4","6.0.5","6.0.6","6.0.7","6.1.0","6.1.0rc0","6.1.1b0","6.2.0","6.2.0rc0","6.2.0rc1","6.2.0rc2","6.3.0","6.3.0b0","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.0.0","7.0.0rc0","7.0.0rc1","7.0.0rc2","7.0.0rc3","7.1.0","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.2.0","7.2.1","7.2.10","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.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"],"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/nbconvert/PYSEC-2026-1691.yaml"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V4","score":"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"}]}