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 package | Versions | Reported 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 more | CVE 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 e44a5cc7677f24b45ebafc756db49058c2f750ea | GitHub Advisory Database, PyPA Advisory Database |
| nbdime (npm) | before 5.0.2, from 6.0.0 before 6.1.2 | GitHub Advisory Database |
| nbdime-jupyterlab (npm) | before 1.0.1, from 2.0.0 before 2.1.1 | GitHub Advisory Database |
| jupyter nbdime-jupyterlab | from 1.0.0 before 1.0.1, from 2.0.0 before 2.1.1 | NVD |
All scores
| GitHub_M | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N |
| GitHub | 8.7medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N |
| NVD | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
| NVD | 3.5low CVSS:2.0 | AV: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
| https://github.com/jupyter/nbdime/security/advisories/GHSA-p6rw-44q7-3fw4 | advisory, third-party-advisory, web | |
| https://github.com/jupyter/nbdime/commit/e44a5cc7677f24b45ebafc756db49058c2f750ea | fix, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-41134 | advisory | |
| https://github.com/jupyter/nbdime | package | |
| https://github.com/pypa/advisory-database/tree/main/vulns/nbdime/PYSEC-2021-428.yaml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-41134 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-p6rw-44q7-3fw4 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-41134 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2021-428 changed 2023-11-08 | CC-BY-4.0 |