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.

Severity (CVSS 3.1)8.7High
Exploit odds (30 days)0.7%top 46.5% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
PyPInbdime1.1.1GHSA-p6rw-44q7-3fw4
PyPInbdime2.1.1GHSA-p6rw-44q7-3fw4
PyPInbdime3.1.1GHSA-p6rw-44q7-3fw4
PyPInbdime1.1.1, 2.1.1, 3.1.1PYSEC-2021-428
npmnbdime6.1.2GHSA-p6rw-44q7-3fw4
npmnbdime5.0.2GHSA-p6rw-44q7-3fw4
npmnbdime-jupyterlab1.0.1GHSA-p6rw-44q7-3fw4
npmnbdime-jupyterlab2.1.1GHSA-p6rw-44q7-3fw4

Affected products (as reported)

VendorProductVersions
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)

Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

References