CVE-2024-28233: Jupyterhub Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-7r3h-4ph8-w38g
CVSS 8.1
CWE-565 CWE-79 CWE-352
Published
Advisory Summary

CVE-2024-28233 is a HIGH (CVSS 8.1) cross-site scripting vulnerability (CWE-565: Reliance on Cookies without Validation and Integrity Checking) affecting Jupyterhub libraries in the PyPI ecosystem. The issue involves cross site scripting (xss) in jupyterhub via self-xss leveraged by cookie tossing. Remediation is available by upgrading affected packages to version 4.1.0.

CVE-2024-28233 at a Glance

CVE Identifier CVE-2024-28233
GHSA Identifier GHSA-7r3h-4ph8-w38g
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-565: Reliance on Cookies without Validation and Integrity Checking
Affected Product Jupyterhub
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.1

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:R/S:U/C:H/I:H/A:N).

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

How to Fix CVE-2024-28233

To remediate this vulnerability, upgrade all affected Jupyterhub 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 fixed: 4.1.0
pip install jupyterhub>=4.1.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

How to Check if You Are Affected

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

pip show jupyterhub

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-565: Reliance on Cookies without Validation and Integrity Checking, where the product relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user. In Jupyterhub, 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 Affected configurations: - Single-origin JupyterHub deployments - JupyterHub deployments with user-controlled applications running on subdomains or peer subdomains of either the Hub or a single-user server. By tricking a user into visiting a malicious subdomain, the attacker can achieve an XSS directly affecting the former's session. More precisely, in the context of JupyterHub, this XSS could achieve the following: - Full access to JupyterHub API and user's single-user server, e.g. - Create and exfiltrate an API Token - Exfiltrate all files hosted on the user's single-user server: notebooks, images, etc. - Install malicious extensions. They can be used as a backdoor to silently regain access to victim's session anytime. ### Patches To prevent cookie-tossing: - Upgrade to JupyterHub 4.1 (both hub and user environment) - enable per-user domains via `c.JupyterHub.subdomain_host = "https://mydomain.example.org"` - set `c.JupyterHub.cookie_host_prefix_enabled = True` to enable domain-locked cookies or, if available (applies to earlier JupyterHub versions): - deploy jupyterhub on its own domain, not shared with any other services - enable per-user domains via `c.JupyterHub.subdomain_host = "https://mydomain.example.org"`

CVE-2024-28233 Affected Jupyterhub Versions

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

References

Frequently Asked Questions

What is CVE-2024-28233?
CVE-2024-28233 is a security vulnerability in Jupyterhub involving Cross site scripting (XSS) in JupyterHub via Self-XSS leveraged by Cookie Tossing under CWE-565: Reliance on Cookies without Validation and Integrity Checking.
Which Jupyterhub versions are affected?
Affected versions include releases prior to 4.1.0 across affected packages: jupyterhub.
What version fixes CVE-2024-28233?
Upgrading to 4.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jupyterhub affected?
Yes, jupyterhub is affected in releases prior to 4.1.0. Upgrade your dependency to 4.1.0 or later.
What is the CVSS score of CVE-2024-28233?
CVE-2024-28233 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2024-28233?
CVE-2024-28233 is classified under CWE-565: Reliance on Cookies without Validation and Integrity Checking (The product relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.).
How can I check PyPI dependencies for CVE-2024-28233?
Run the dependency tree command: 'pip show jupyterhub'. 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-7r3h-4ph8-w38g",
  "modified" : "2024-03-28T17:08:10Z",
  "published" : "2024-03-28T17:08:10Z",
  "aliases" : [ "CVE-2024-28233" ],
  "summary" : "Cross site scripting (XSS) in JupyterHub via Self-XSS leveraged by Cookie Tossing",
  "details" : "### Impact\n\nAffected configurations:\n\n- Single-origin JupyterHub deployments\n- JupyterHub deployments with user-controlled applications running on subdomains or peer subdomains of either the Hub or a single-user server.\n\nBy tricking a user into visiting a malicious subdomain, the attacker can achieve an XSS directly affecting the former's session. More precisely, in the context of JupyterHub, this XSS could achieve the following:\n\n- Full access to JupyterHub API and user's single-user server, e.g.\n  - Create and exfiltrate an API Token\n  - Exfiltrate all files hosted on the user's single-user server: notebooks, images, etc.\n  - Install malicious extensions. They can be used as a backdoor to silently regain access to victim's session anytime.\n\n### Patches\n\nTo prevent cookie-tossing:\n\n- Upgrade to JupyterHub 4.1 (both hub and user environment)\n- enable per-user domains via `c.JupyterHub.subdomain_host = \"https://mydomain.example.org\"`\n- set `c.JupyterHub.cookie_host_prefix_enabled = True` to enable domain-locked cookies\n\nor, if available (applies to earlier JupyterHub versions):\n\n- deploy jupyterhub on its own domain, not shared with any other services\n- enable per-user domains via `c.JupyterHub.subdomain_host = \"https://mydomain.example.org\"`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "jupyterhub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jupyterhub/jupyterhub/security/advisories/GHSA-7r3h-4ph8-w38g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-28233"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jupyterhub/jupyterhub/commit/e2798a088f5ad45340fe79cdf1386198e664f77f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jupyterhub/jupyterhub"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352", "CWE-565", "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-28T17:08:10Z",
    "nvd_published_at" : "2024-03-27T19:15:48Z"
  }
}