Vulnerability · Published Nov 3, 2021 · Assigned by GitHub_M
CVE-2021-41134Stored XSS in Jupyter nbdime
High 8.7
In plain English
A high-severity cross-site scripting in nbdime from jupyter. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 53% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | nbdime | 1.1.1 | GHSA-p6rw-44q7-3fw4 |
| PyPI | nbdime | 2.1.1 | GHSA-p6rw-44q7-3fw4 |
| PyPI | nbdime | 3.1.1 | GHSA-p6rw-44q7-3fw4 |
| PyPI | nbdime | 1.1.1, 2.1.1, 3.1.1 | PYSEC-2021-428 |
| npm | nbdime | 6.1.2 | GHSA-p6rw-44q7-3fw4 |
| npm | nbdime | 5.0.2 | GHSA-p6rw-44q7-3fw4 |
| npm | nbdime-jupyterlab | 1.0.1 | GHSA-p6rw-44q7-3fw4 |
| npm | nbdime-jupyterlab | 2.1.1 | GHSA-p6rw-44q7-3fw4 |
Affected products (as reported)
Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N