CVE-2024-28179
📋 TL;DR
Jupyter Server Proxy versions before 3.2.3 and 4.1.1 fail to properly authenticate websocket connections, allowing unauthenticated network access to proxied websocket endpoints. This can lead to remote arbitrary code execution when websockets are used for command execution. Anyone running vulnerable Jupyter Server Proxy instances with websocket-enabled services is affected.
💻 Affected Systems
- Jupyter Server Proxy
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Remote unauthenticated attackers gain arbitrary code execution on the Jupyter server host, potentially leading to full system compromise, data theft, and lateral movement.
Likely Case
Unauthenticated access to backend services via websockets, enabling command execution, data exfiltration, or service disruption depending on what websocket endpoints are exposed.
If Mitigated
If proper network segmentation and authentication controls exist, impact is limited to unauthorized access to specific websocket services without escalation.
🎯 Exploit Status
Exploitation requires knowledge of websocket endpoints but is straightforward once endpoints are identified. The vulnerability is in authentication bypass, not a complex memory corruption issue.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.2.3 or 4.1.1
Vendor Advisory: https://github.com/jupyterhub/jupyter-server-proxy/security/advisories/GHSA-w3vc-fx9p-wp4v
Restart Required: Yes
Instructions:
1. Update Jupyter Server Proxy using pip: 'pip install --upgrade jupyter-server-proxy>=3.2.3' or 'pip install --upgrade jupyter-server-proxy>=4.1.1'. 2. Restart the Jupyter server. 3. Verify the update with 'pip show jupyter-server-proxy'.
🔧 Temporary Workarounds
Disable websocket proxying
allIf websocket functionality is not required, disable websocket proxying entirely
Configure Jupyter Server Proxy to not proxy websocket connections by modifying server configuration
Network access restrictions
linuxRestrict network access to Jupyter server endpoints using firewall rules
iptables -A INPUT -p tcp --dport <jupyter-port> -s <trusted-networks> -j ACCEPT
iptables -A INPUT -p tcp --dport <jupyter-port> -j DROP
🧯 If You Can't Patch
- Implement strict network segmentation to isolate Jupyter servers from untrusted networks
- Deploy a reverse proxy with proper authentication in front of Jupyter Server Proxy
🔍 How to Verify
Check if Vulnerable:
Check Jupyter Server Proxy version: 'pip show jupyter-server-proxy | grep Version'. If version is below 3.2.3 or 4.1.1, the system is vulnerable.
Check Version:
pip show jupyter-server-proxy | grep Version
Verify Fix Applied:
After patching, verify version is 3.2.3 or higher (for 3.x) or 4.1.1 or higher (for 4.x). Test websocket connections require authentication.
📡 Detection & Monitoring
Log Indicators:
- Unauthenticated websocket connection attempts
- Websocket connections without corresponding authentication logs
- Unexpected process execution from Jupyter context
Network Indicators:
- Websocket traffic to Jupyter server without preceding authentication handshake
- Unusual websocket patterns to non-standard ports
SIEM Query:
source="jupyter" AND (websocket OR ws://) AND NOT (authenticated OR auth_success)
🔗 References
- https://github.com/jupyterhub/jupyter-server-proxy/blob/9b624c4d9507176334b46a85d94a4aa3bcd29bed/jupyter_server_proxy/handlers.py#L433
- https://github.com/jupyterhub/jupyter-server-proxy/commit/764e499f61a87641916a7a427d4c4b1ac3f321a9
- https://github.com/jupyterhub/jupyter-server-proxy/commit/bead903b7c0354b6efd8b4cde94b89afab653e03
- https://github.com/jupyterhub/jupyter-server-proxy/security/advisories/GHSA-w3vc-fx9p-wp4v
- https://github.com/jupyterhub/jupyter-server-proxy/blob/9b624c4d9507176334b46a85d94a4aa3bcd29bed/jupyter_server_proxy/handlers.py#L433
- https://github.com/jupyterhub/jupyter-server-proxy/commit/764e499f61a87641916a7a427d4c4b1ac3f321a9
- https://github.com/jupyterhub/jupyter-server-proxy/commit/bead903b7c0354b6efd8b4cde94b89afab653e03
- https://github.com/jupyterhub/jupyter-server-proxy/security/advisories/GHSA-w3vc-fx9p-wp4v