CVE-2024-28233: Cross site scripting (XSS) in JupyterHub via Self-XSS leveraged by Cookie Tossing
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.
Published Mar 28, 2024
Affected packages
jupyterhub
- Ecosystem
- PyPI
- Affected
- < 4.1.0
- Fixed in
- 4.1.0
- Check
pip show jupyterhub
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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 = Trueto 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"
Credited to Th0h0.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-54338
JupyterHub has Unauthenticated Denial of Service via Unbounded Username Logging on Failed Login
medium5.3Aug 25, 2026CVE-2026-40864
JupyterHub has cross-origin form POSTs bypass XSRF (CWE-352)
medium5.4May 5, 2026CVE-2026-33709
JupyterHub has an Open Redirect Vulnerability
medium6.1Apr 3, 2026CVE-2024-41942
JupyterHub has a privilege escalation vulnerability with the `admin:users` scope
high7.2Aug 8, 2024
