Skip to content

Cross site scripting (XSS) in JupyterHub via Self-XSS leveraged by Cookie Tossing

High severity GitHub Reviewed Published Mar 27, 2024 in jupyterhub/jupyterhub • Updated Mar 28, 2024

Package

pip jupyterhub (pip)

Affected versions

< 4.1.0

Patched versions

4.1.0

Description

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"

References

@minrk minrk published to jupyterhub/jupyterhub Mar 27, 2024
Published by the National Vulnerability Database Mar 27, 2024
Published to the GitHub Advisory Database Mar 28, 2024
Reviewed Mar 28, 2024
Last updated Mar 28, 2024

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

EPSS score

0.043%
(10th percentile)

CVE ID

CVE-2024-28233

GHSA ID

GHSA-7r3h-4ph8-w38g

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.