CVE-2021-41134
JSON

8.7high

Stored XSS in Jupyter nbdime

Severity
8.7high CVSS:3.1 by GitHub_M
Exploit likelihood
0.70% (higher than 54% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-p6rw-44q7-3fw4PYSEC-2021-428

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

Product or packageVersionsReported by
jupyter nbdime< 1.1.1 - nbdime (pip), >= 2.0.0 , < 2.1.1 - nbdime (pip), >= 3.0.0, < 3.1.1 - nbdime (pip), < 5.0.2 - nbdime (npm), >= 6.0.0, < 6.1.2 - nbdime (npm), < 1.0.1 - nbdime-jupyterlab (npm), >= 2.0.0, < 2.1.1 - nbdime-jupyterlab (npm), from 1.0.0 before 1.1.1 and 4 moreCVE List, NVD
nbdime (PyPI)before 1.1.1, from 2.0.0 before 2.1.1, from 3.0.0 before 3.1.1, before e44a5cc7677f24b45ebafc756db49058c2f750eaGitHub Advisory Database, PyPA Advisory Database
nbdime (npm)before 5.0.2, from 6.0.0 before 6.1.2GitHub Advisory Database
nbdime-jupyterlab (npm)before 1.0.1, from 2.0.0 before 2.1.1GitHub Advisory Database
jupyter nbdime-jupyterlabfrom 1.0.0 before 1.0.1, from 2.0.0 before 2.1.1NVD

All scores

GitHub_M8.7high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
GitHub8.7medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
NVD5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
NVD3.5low CVSS:2.0AV:N/AC:M/Au:S/C:N/I:P/A:N

Classification

What each source says

CVE List

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.

GitHub Advisory Database
Impact

Improper handling of user controlled input caused a stored cross-site scripting (XSS) vulnerability. All previous versions of nbdime are affected.

Patches

Security patches will be released for each of the major versions of the nbdime packages since version 1.x of the nbdime python package.

Python
  • nbdime 1.x: Patched in v. 1.1.1
  • nbdime 2.x: Patched in v. 2.1.1
  • nbdime 3.x: Patched in v. 3.1.1
npm
  • nbdime 6.x version: Patched in 6.1.2
  • nbdime 5.x version: Patched in 5.0.2
  • nbdime-jupyterlab 1.x version: Patched in 1.0.1
  • nbdime-jupyterlab 2.x version: Patched in 2.1.1
For more information

If you have any questions or comments about this advisory email us at security@ipython.org.

NVD (es)

nbdime proporciona herramientas para diferenciar y fusionar cuadernos Jupyter. En las versiones afectadas se presenta un problema de tipo cross-site scripting (XSS) almacenado en el proyecto nbdime, propiedad de Jupyter. Parece que cuando se lee el nombre del archivo y la ruta desde el disco, la extensión no sanea la cadena que construye antes de devolverla para que se muestre. La función diffNotebookCheckpoint dentro de nbdime causa este problema. Cuando es intentado mostrar el nombre del cuaderno local (diffNotebookCheckpoint), nbdime parece añadir simplemente .ipynb al nombre del archivo de entrada. El NbdimeWidget es creado entonces, y la cadena base es pasada mediante la función API de petición. A partir de ahí, el frontend simplemente renderiza la etiqueta HTML y todo lo que la acompaña. Es recomendado a usuarios aplicar el parche a la versión más reciente del producto afectado

References

Sources

SourceRecordLicence
CVE ListCVE-2021-41134 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-p6rw-44q7-3fw4 changed 2026-07-08CC-BY-4.0
NVDCVE-2021-41134 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-428 changed 2023-11-08CC-BY-4.0