Lucene search

K
githubGitHub Advisory DatabaseGHSA-7R3H-4PH8-W38G
HistoryMar 28, 2024 - 5:08 p.m.

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

2024-03-2817:08:10
CWE-79
CWE-352
CWE-565
GitHub Advisory Database
github.com
4
jupyterhub
self-xss
cookie tossing
api access
user data exfiltration
malicious extensions
per-user domains
domain-locked cookies
upgrade
patching

8.1 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

REQUIRED

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

NONE

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

6 Medium

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

9.1%

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"

Affected configurations

Vulners
Node
jupyterjupyterhubRange<4.1.0
CPENameOperatorVersion
jupyterhublt4.1.0

8.1 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

REQUIRED

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

NONE

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

6 Medium

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

9.1%