CVE-2024-28233
📋 TL;DR
CVE-2024-28233 is a cross-site scripting (XSS) vulnerability in JupyterHub that allows attackers to achieve full access to the JupyterHub API and user's single-user server by tricking users into visiting malicious subdomains. This affects single-origin JupyterHub deployments and deployments with user-controlled applications running on subdomains or peer subdomains. The vulnerability enables attackers to compromise user sessions and gain unauthorized access.
💻 Affected Systems
- JupyterHub
📦 What is this software?
Jupyterhub by Jupyter
⚠️ Risk & Real-World Impact
Worst Case
Full compromise of JupyterHub API access leading to complete control over user sessions, data theft, and potential lateral movement within the environment.
Likely Case
Session hijacking, unauthorized access to user notebooks and data, and potential privilege escalation within JupyterHub.
If Mitigated
Limited impact with proper subdomain isolation and content security policies in place.
🎯 Exploit Status
Exploitation requires social engineering to trick users into visiting malicious subdomains, but the technical execution is straightforward once the user is lured.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.1.0
Vendor Advisory: https://github.com/jupyterhub/jupyterhub/security/advisories/GHSA-7r3h-4ph8-w38g
Restart Required: Yes
Instructions:
1. Update JupyterHub to version 4.1.0 or later using pip: 'pip install --upgrade jupyterhub==4.1.0' 2. Restart the JupyterHub service 3. Verify the update was successful
🔧 Temporary Workarounds
Implement Content Security Policy
allAdd strict Content Security Policy headers to prevent XSS execution
Add 'Content-Security-Policy: default-src 'self'; script-src 'self';' to JupyterHub configuration
Subdomain Isolation
allEnsure user applications are not hosted on subdomains or peer subdomains of Hub or single-user servers
Review and reconfigure JupyterHub deployment to avoid vulnerable subdomain configurations
🧯 If You Can't Patch
- Implement strict network segmentation to isolate JupyterHub from untrusted networks
- Deploy web application firewall (WAF) with XSS protection rules
🔍 How to Verify
Check if Vulnerable:
Check JupyterHub version: if version is below 4.1.0 and deployment matches affected configurations, system is vulnerable
Check Version:
jupyterhub --version
Verify Fix Applied:
Verify JupyterHub version is 4.1.0 or higher using 'jupyterhub --version'
📡 Detection & Monitoring
Log Indicators:
- Unusual subdomain access patterns
- Multiple failed authentication attempts from unexpected subdomains
- Suspicious JavaScript execution in user sessions
Network Indicators:
- Requests to malicious subdomains
- Unexpected cross-origin requests from JupyterHub sessions
SIEM Query:
source="jupyterhub" AND (url="*malicious-subdomain*" OR event="XSS_attempt")
🔗 References
- https://github.com/jupyterhub/jupyterhub/commit/e2798a088f5ad45340fe79cdf1386198e664f77f
- https://github.com/jupyterhub/jupyterhub/security/advisories/GHSA-7r3h-4ph8-w38g
- https://github.com/jupyterhub/jupyterhub/commit/e2798a088f5ad45340fe79cdf1386198e664f77f
- https://github.com/jupyterhub/jupyterhub/security/advisories/GHSA-7r3h-4ph8-w38g