Vulnerabilities in pkg:pypi/jupyter-lsp

PACKAGE
Advisory Identifier: GHSA-4qhp-652w-c22x
Advisory Summary

CVE-2024-22415 is a HIGH (CVSS 7.3) unsecured endpoints vulnerability (CWE-23: Relative Path Traversal) affecting Jupyter lsp libraries in the PyPI ecosystem. The issue involves unsecured endpoints in the jupyter-lsp server extension. Remediation is available by upgrading affected packages to version 2.2.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/jupyter-lsp

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-4qhp-652w-c22x CVE-2024-22415 HIGH Unsecured endpoints in the jupyter-lsp server extension

CVE-2024-22415 at a Glance

CVE Identifier CVE-2024-22415
GHSA Identifier GHSA-4qhp-652w-c22x
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-23: Relative Path Traversal
Affected Product Jupyter lsp
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.3

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

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

How to Fix CVE-2024-22415

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

jupyter-lsp fixed: 2.2.2
pip install jupyter-lsp>=2.2.2
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 jupyter-lsp

How to Check if You Are Affected

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

pip show jupyter-lsp

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. In Jupyter lsp, 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 Installations of jupyter-lsp running in environments without configured file system access control (on the operating system level), and with jupyter-server instances exposed to non-trusted network are vulnerable to unauthorised access and modification of file system beyond the jupyter root directory. ### Patches Version 2.2.2 has been patched. ### Workarounds Users of jupyterlab who do not use jupyterlab-lsp can uninstall jupyter-lsp. ### Credits We would like to credit Bary Levy, researcher of pillar.security research team, for the discovery and responsible disclosure of this vulnerability. Edit: based on advice from pillar.security the Confidentiality/Integrity/Availability were increased to High to reflect potential for critical impact on publicly hosted jupyter-server instances lacking isolation of user privileges on operating system level (for best practices please consult https://jupyterhub.readthedocs.io/en/stable/explanation/websecurity.html#protect-users-from-each-other) and CWE-94 was added due to a potential vulnerability chaining in specific environments.

CVE-2024-22415 Affected Jupyter lsp Versions

1 component(s)
Fixed Versions:
2.2.2
Product / Package Ecosystem Affected Versions Fixed Version
jupyter-lsp
PyPI
< 2.2.2
2.2.2

References

Frequently Asked Questions

What is CVE-2024-22415?
CVE-2024-22415 is a security vulnerability in Jupyter lsp involving Unsecured endpoints in the jupyter-lsp server extension under CWE-23: Relative Path Traversal.
Which Jupyter lsp versions are affected?
Affected versions include releases prior to 2.2.2 across affected packages: jupyter-lsp.
What version fixes CVE-2024-22415?
Upgrading to 2.2.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jupyter-lsp affected?
Yes, jupyter-lsp is affected in releases prior to 2.2.2. Upgrade your dependency to 2.2.2 or later.
What is the CVSS score of CVE-2024-22415?
CVE-2024-22415 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2024-22415?
CVE-2024-22415 is classified under CWE-23: Relative Path Traversal (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.).
How can I check PyPI dependencies for CVE-2024-22415?
Run the dependency tree command: 'pip show jupyter-lsp'. 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-4qhp-652w-c22x",
  "modified" : "2024-01-19T20:32:07Z",
  "published" : "2024-01-18T16:12:28Z",
  "aliases" : [ "CVE-2024-22415" ],
  "summary" : "Unsecured endpoints in the jupyter-lsp server extension",
  "details" : "### Impact\nInstallations of jupyter-lsp running in environments without configured file system access control (on the operating system level), and with jupyter-server instances exposed to non-trusted network are vulnerable to unauthorised access and modification of file system beyond the jupyter root directory.\n\n### Patches\nVersion 2.2.2 has been patched.\n\n### Workarounds\nUsers of jupyterlab who do not use jupyterlab-lsp can uninstall jupyter-lsp.\n\n### Credits\nWe would like to credit Bary Levy, researcher of pillar.security research team, for the discovery and responsible disclosure of this vulnerability.\n\nEdit: based on advice from pillar.security the Confidentiality/Integrity/Availability were increased to High to reflect potential for critical impact on publicly hosted jupyter-server instances lacking isolation of user privileges on operating system level (for best practices please consult https://jupyterhub.readthedocs.io/en/stable/explanation/websecurity.html#protect-users-from-each-other) and CWE-94 was added due to a potential vulnerability chaining in specific environments.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "jupyter-lsp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.2.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jupyter-lsp/jupyterlab-lsp/security/advisories/GHSA-4qhp-652w-c22x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22415"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jupyter-lsp/jupyterlab-lsp/commit/4ad12f204ad0b85580fc32137c647baaff044e95"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jupyter-lsp/jupyterlab-lsp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jupyter-lsp/jupyterlab-lsp/releases/tag/v5.0.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-23" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-18T16:12:28Z",
    "nvd_published_at" : "2024-01-18T21:15:09Z"
  }
}