Vulnerabilities in pkg:pypi/jupyterhub-kubespawner

PACKAGE
Advisory Identifier: GHSA-v7m9-9497-p9gr
Advisory Summary

CVE-2020-15110 is a HIGH (CVSS 6.8) possible pod name collisions vulnerability (CWE-863: Incorrect Authorization) affecting Jupyterhub kubespawner libraries in the PyPI ecosystem. The issue involves possible pod name collisions in jupyterhub-kubespawner. Remediation is available by upgrading affected packages to version 0.12.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/jupyterhub-kubespawner

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-v7m9-9497-p9gr CVE-2020-15110 HIGH Possible pod name collisions in jupyterhub-kubespawner

CVE-2020-15110 at a Glance

CVE Identifier CVE-2020-15110
GHSA Identifier GHSA-v7m9-9497-p9gr
Severity HIGH
CVSS v3.1 Base Score 6.8
CWE Classification CWE-863: Incorrect Authorization
Affected Product Jupyterhub kubespawner
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.8

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

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

How to Fix CVE-2020-15110

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

jupyterhub-kubespawner fixed: 0.12.0
pip install jupyterhub-kubespawner>=0.12.0
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 jupyterhub-kubespawner

How to Check if You Are Affected

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

pip show jupyterhub-kubespawner

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Jupyterhub kubespawner, 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 _What kind of vulnerability is it? Who is impacted?_ JupyterHub deployments using: - KubeSpawner <= 0.11.1 (e.g. zero-to-jupyterhub 0.9.0) and - enabled named_servers (not default), and - an Authenticator that allows: - usernames with hyphens or other characters that require escape (e.g. `user-hyphen` or `user@email`), and - usernames which may match other usernames up to but not including the escaped character (e.g. `user` in the above cases) In this circumstance, certain usernames will be able to craft particular server names which will grant them access to the default server of other users who have matching usernames. ### Patches _Has the problem been patched? What versions should users upgrade to?_ Patch will be released in kubespawner 0.12 and zero-to-jupyterhub 0.9.1 ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ #### KubeSpawner Specify configuration: for KubeSpawner ```python from traitlets import default from kubespawner import KubeSpawner class PatchedKubeSpawner(KubeSpawner): @default("pod_name_template") def _default_pod_name_template(self): if self.name: return "jupyter-{username}-{servername}" else: return "jupyter-{username}" @default("pvc_name_template") def _default_pvc_name_template(self): if self.name: return "claim-{username}-{servername}" else: return "claim-{username}" c.JupyterHub.spawner_class = PatchedKubeSpawner ``` **Note for KubeSpawner:** this configuration will behave differently before and after the upgrade, so will need to be removed when upgrading. Only apply this configuration while still using KubeSpawner ≤ 0.11.1 and remove it after upgrade to ensure consistent pod and pvc naming. Changing the name template means pvcs for named servers will have different names. This will result in orphaned PVCs for named servers across Hub upgrade! This may appear as data loss for users, depending on configuration, but the orphaned PVCs will still be around and data can be migrated manually (or new PVCs created manually to reference existing PVs) before deleting the old PVCs and/or PVs. ### References _Are there any links users can visit to find out more?_ ### For more information If you have any questions or comments about this advisory: * Open an issue in [kubespawner](https://github.com/jupyterhub/kubespawner) * Email us at [security@ipython.org](mailto:security@ipython.org) Credit: Jining Huang

CVE-2020-15110 Affected Jupyterhub kubespawner Versions

1 component(s)
Fixed Versions:
0.12.0
Product / Package Ecosystem Affected Versions Fixed Version
jupyterhub-kubespawner
PyPI
< 0.12.0
0.12.0

References

Frequently Asked Questions

What is CVE-2020-15110?
CVE-2020-15110 is a security vulnerability in Jupyterhub kubespawner involving Possible pod name collisions in jupyterhub-kubespawner under CWE-863: Incorrect Authorization.
Which Jupyterhub kubespawner versions are affected?
Affected versions include releases prior to 0.12.0 across affected packages: jupyterhub-kubespawner.
What version fixes CVE-2020-15110?
Upgrading to 0.12.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jupyterhub-kubespawner affected?
Yes, jupyterhub-kubespawner is affected in releases prior to 0.12.0. Upgrade your dependency to 0.12.0 or later.
What is the CVSS score of CVE-2020-15110?
CVE-2020-15110 has a CVSS v3.1 base score of 6.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2020-15110?
CVE-2020-15110 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check PyPI dependencies for CVE-2020-15110?
Run the dependency tree command: 'pip show jupyterhub-kubespawner'. 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-v7m9-9497-p9gr",
  "modified" : "2024-09-24T20:43:31Z",
  "published" : "2020-07-22T23:07:16Z",
  "aliases" : [ "CVE-2020-15110" ],
  "summary" : "Possible pod name collisions in jupyterhub-kubespawner",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nJupyterHub deployments using:\n\n- KubeSpawner <= 0.11.1 (e.g. zero-to-jupyterhub 0.9.0) and\n- enabled named_servers (not default), and\n- an Authenticator that allows:\n  - usernames with hyphens or other characters that require escape (e.g. `user-hyphen` or `user@email`), and\n  - usernames which may match other usernames up to but not including the escaped character (e.g. `user` in the above cases)\n\nIn this circumstance, certain usernames will be able to craft particular server names which will grant them access to the default server of other users who have matching usernames.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nPatch will be released in kubespawner 0.12 and zero-to-jupyterhub 0.9.1\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\n#### KubeSpawner\n\nSpecify configuration:\n\nfor KubeSpawner\n```python\nfrom traitlets import default\nfrom kubespawner import KubeSpawner\n\nclass PatchedKubeSpawner(KubeSpawner):\n    @default(\"pod_name_template\")\n    def _default_pod_name_template(self):\n        if self.name:\n            return \"jupyter-{username}-{servername}\"\n        else:\n            return \"jupyter-{username}\"\n\n    @default(\"pvc_name_template\")\n    def _default_pvc_name_template(self):\n        if self.name:\n            return \"claim-{username}-{servername}\"\n        else:\n            return \"claim-{username}\"\n\nc.JupyterHub.spawner_class = PatchedKubeSpawner\n```\n\n**Note for KubeSpawner:** this configuration will behave differently before and after the upgrade, so will need to be removed when upgrading. Only apply this configuration while still using KubeSpawner ≤ 0.11.1 and remove it after upgrade to ensure consistent pod and pvc naming.\n\nChanging the name template means pvcs for named servers will have different names. This will result in orphaned PVCs for named servers across Hub upgrade! This may appear as data loss for users, depending on configuration, but the orphaned PVCs will still be around and data can be migrated manually (or new PVCs created manually to reference existing PVs) before deleting the old PVCs and/or PVs.\n\n### References\n_Are there any links users can visit to find out more?_\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [kubespawner](https://github.com/jupyterhub/kubespawner)\n* Email us at [security@ipython.org](mailto:security@ipython.org)\n\nCredit: Jining Huang",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "jupyterhub-kubespawner"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.12.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.11.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jupyterhub/kubespawner/security/advisories/GHSA-v7m9-9497-p9gr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15110"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jupyterhub/kubespawner/commit/3dfe870a7f5e98e2e398b01996ca6b8eff4bb1d0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jupyterhub/kubespawner"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/jupyterhub-kubespawner/PYSEC-2020-51.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-07-17T20:49:37Z",
    "nvd_published_at" : "2020-07-17T21:15:00Z"
  }
}