Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLXY3bTktOTQ5Ny1wOWdy

Possible pod name collisions in jupyterhub-kubespawner

Impact

What kind of vulnerability is it? Who is impacted?

JupyterHub deployments using:

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

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:

Credit: Jining Huang

Permalink: https://github.com/advisories/GHSA-v7m9-9497-p9gr
JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLXY3bTktOTQ5Ny1wOWdy
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: almost 4 years ago
Updated: about 1 year ago


CVSS Score: 6.8
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N

Identifiers: GHSA-v7m9-9497-p9gr, CVE-2020-15110
References: Repository: https://github.com/jupyterhub/kubespawner
Blast Radius: 11.9

Affected Packages

pypi:jupyterhub-kubespawner
Dependent packages: 1
Dependent repositories: 57
Downloads: 13,970 last month
Affected Version Ranges: <= 0.11.1
Fixed in: 0.12
All affected versions: 0.5.1, 0.6.0, 0.7.1, 0.8.1, 0.9.0, 0.10.0, 0.10.1, 0.11.0, 0.11.1
All unaffected versions: 0.12.0, 0.13.0, 0.14.0, 0.14.1, 0.15.0, 0.16.0, 0.16.1, 1.0.0, 1.1.0, 1.1.1, 1.1.2, 2.0.0, 2.0.1, 3.0.0, 3.0.1, 3.0.2, 4.0.0, 4.1.0, 4.2.0, 4.3.0, 5.0.0, 6.0.0, 6.1.0, 6.2.0