What’s Vulnerable › Vulnerabilities
CVE-2021-41134: Stored XSS in Jupyter nbdime
- Severity: medium (CVSS 5.4 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.7% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2021-11-03 · updated 2026-06-17
- Weakness: CWE-79
Description
nbdime provides tools for diffing and merging of Jupyter Notebooks. In affected versions a stored cross-site scripting (XSS) issue exists within the Jupyter-owned nbdime project. It appears that when reading the file name and path from disk, the extension does not sanitize the string it constructs before returning it to be displayed. The diffNotebookCheckpoint function within nbdime causes this issue. When attempting to display the name of the local notebook (diffNotebookCheckpoint), nbdime appears to simply append .ipynb to the name of the input file. The NbdimeWidget is then created, and the base string is passed through to the request API function. From there, the frontend simply renders the HTML tag and anything along with it. Users are advised to patch to the most recent version of the affected product.
Affected products
- jupyter nbdime: from 1.0.0 before 1.1.1; from 2.0.0 before 2.1.1; from 3.0.0 through 3.1.1; from 5.0.0 before 5.0.2; from 6.0.0 before 6.1.2 — fixed in 1.1.1, 2.1.1, 5.0.2, 6.1.2
- jupyter Nbdime-Jupyterlab: from 1.0.0 before 1.0.1; from 2.0.0 before 2.1.1 — fixed in 1.0.1, 2.1.1
How to fix
Upgrade to a fixed version: jupyter nbdime 1.1.1, 2.1.1, 5.0.2, 6.1.2; jupyter Nbdime-Jupyterlab 1.0.1, 2.1.1. Check the vendor advisory for mitigations.
References
- https://github.com/jupyter/nbdime/commit/e44a5cc7677f24b45ebafc756db49058c2f750ea
- https://github.com/jupyter/nbdime/security/advisories/GHSA-p6rw-44q7-3fw4
- https://github.com/jupyter/nbdime/commit/e44a5cc7677f24b45ebafc756db49058c2f750ea
- https://github.com/jupyter/nbdime/security/advisories/GHSA-p6rw-44q7-3fw4
Get alerted when CVE-2021-41134 or the next vulnerability affects your stack