Vulnerabilities in pkg:pypi/nbdime

PACKAGE
Advisory Identifier: GHSA-p6rw-44q7-3fw4
Advisory Summary

CVE-2021-41134 is a MODERATE (CVSS 8.7) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Nbdime libraries in the PyPI ecosystem. The issue involves stored xss in jupyter nbdime. Remediation is available by upgrading affected packages to version 1.1.1, 2.1.1, 3.1.1, 5.0.2, 6.1.2, 1.0.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/nbdime

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/nbdime. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-p6rw-44q7-3fw4 CVE-2021-41134 MODERATE Stored XSS in Jupyter nbdime

CVE-2021-41134 at a Glance

CVE Identifier CVE-2021-41134
GHSA Identifier GHSA-p6rw-44q7-3fw4
Severity MODERATE
CVSS v3.1 Base Score 8.7
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Nbdime
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2021-41134

To remediate this vulnerability, upgrade all affected Nbdime dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nbdime fixed: 1.1.1
pip install nbdime>=1.1.1
nbdime fixed: 2.1.1
pip install nbdime>=2.1.1
nbdime fixed: 3.1.1
pip install nbdime>=3.1.1
nbdime fixed: 5.0.2
npm install nbdime@5.0.2
nbdime fixed: 6.1.2
npm install nbdime@6.1.2
nbdime-jupyterlab fixed: 1.0.1
npm install nbdime-jupyterlab@1.0.1
nbdime-jupyterlab fixed: 2.1.1
npm install nbdime-jupyterlab@2.1.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show nbdime

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2021-41134, inspect your installed packages using pip:

pip show nbdime

Analyze the terminal output to locate any version of Nbdime in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.1), your application is affected.

Note: The pip show nbdime command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Nbdime, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](mailto:security@ipython.org).

CVE-2021-41134 Affected Nbdime Versions

7 component(s)
Fixed Versions:
1.1.12.1.13.1.15.0.26.1.21.0.1
Product / Package Ecosystem Affected Versions Fixed Version
nbdime
PyPI
< 1.1.1
1.1.1
nbdime
PyPI
≥ 2.0.0
< 2.1.1
2.1.1
nbdime
PyPI
≥ 3.0.0
< 3.1.1
3.1.1
nbdime
npm
< 5.0.2
5.0.2
nbdime
npm
≥ 6.0.0
< 6.1.2
6.1.2
nbdime-jupyterlab
npm
< 1.0.1
1.0.1
nbdime-jupyterlab
npm
≥ 2.0.0
< 2.1.1
2.1.1

References

Frequently Asked Questions

What is CVE-2021-41134?
CVE-2021-41134 is a security vulnerability in Nbdime involving Stored XSS in Jupyter nbdime under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Nbdime versions are affected?
Affected versions include releases prior to 1.1.1, 2.1.1, 3.1.1, 5.0.2, 6.1.2, 1.0.1 across affected packages: nbdime, nbdime-jupyterlab.
What version fixes CVE-2021-41134?
Upgrading to 1.1.1, 2.1.1, 3.1.1, 5.0.2, 6.1.2, 1.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nbdime affected?
Yes, nbdime is affected in releases prior to 1.1.1, 2.1.1, 3.1.1, 5.0.2, 6.1.2. Upgrade your dependency to 1.1.1, 2.1.1, 3.1.1, 5.0.2, 6.1.2 or later.
Is nbdime-jupyterlab affected?
Yes, nbdime-jupyterlab is affected in releases prior to 1.0.1, 2.1.1. Upgrade your dependency to 1.0.1, 2.1.1 or later.
What is the CVSS score of CVE-2021-41134?
CVE-2021-41134 has a CVSS v3.1 base score of 8.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2021-41134?
CVE-2021-41134 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check PyPI dependencies for CVE-2021-41134?
Run the dependency tree command: 'pip show nbdime'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p6rw-44q7-3fw4",
  "modified" : "2024-10-01T19:31:58Z",
  "published" : "2021-11-08T18:09:27Z",
  "aliases" : [ "CVE-2021-41134" ],
  "summary" : "Stored XSS in Jupyter nbdime",
  "details" : "### Impact\n\nImproper handling of user controlled input caused a stored cross-site scripting (XSS) vulnerability. All previous versions of nbdime are affected.\n\n### Patches\n\nSecurity patches will be released for each of the major versions of the nbdime packages since version 1.x of the nbdime python package.\n\n#### Python\n- nbdime 1.x: Patched in v. 1.1.1\n- nbdime 2.x: Patched in v. 2.1.1\n- nbdime 3.x: Patched in v. 3.1.1\n\n#### npm\n- nbdime 6.x version: Patched in 6.1.2\n- nbdime 5.x version: Patched in 5.0.2\n- nbdime-jupyterlab 1.x version: Patched in 1.0.1\n- nbdime-jupyterlab 2.x version: Patched in 2.1.1\n\n### For more information\nIf you have any questions or comments about this advisory email us at [security@ipython.org](mailto:security@ipython.org).\n\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nbdime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nbdime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nbdime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nbdime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nbdime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.1.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nbdime-jupyterlab"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nbdime-jupyterlab"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jupyter/nbdime/security/advisories/GHSA-p6rw-44q7-3fw4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41134"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jupyter/nbdime/commit/e44a5cc7677f24b45ebafc756db49058c2f750ea"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jupyter/nbdime"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nbdime/PYSEC-2021-428.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-03T18:13:40Z",
    "nvd_published_at" : "2021-11-03T18:15:00Z"
  }
}