CVE-2022-24758
📋 TL;DR
This vulnerability in Jupyter Notebook allows unauthorized actors to access sensitive authentication cookies and header values from server logs when 5xx errors occur. Attackers can monitor these logs to steal credentials and gain unauthorized access to Jupyter servers. All Jupyter Notebook installations prior to version 6.4.9 are affected.
💻 Affected Systems
- Jupyter Notebook
📦 What is this software?
Notebook by Jupyter
⚠️ Risk & Real-World Impact
Worst Case
Attackers gain full administrative access to Jupyter servers, potentially compromising sensitive data, executing arbitrary code, and pivoting to other systems.
Likely Case
Unauthorized access to Jupyter notebooks, data exfiltration, and potential privilege escalation within the Jupyter environment.
If Mitigated
Limited impact with proper log access controls and monitoring, though sensitive information may still be exposed in logs.
🎯 Exploit Status
Exploitation requires access to server logs and ability to trigger 5xx errors. No authentication needed to trigger the error condition.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 6.4.9
Vendor Advisory: https://github.com/jupyter/notebook/security/advisories/GHSA-m87f-39q9-6f55
Restart Required: Yes
Instructions:
1. Backup your Jupyter notebooks and configuration. 2. Update Jupyter Notebook using pip: 'pip install --upgrade notebook==6.4.9'. 3. Restart the Jupyter server. 4. Verify the update with 'jupyter notebook --version'.
🔧 Temporary Workarounds
Restrict Log File Access
linuxSet strict file permissions on Jupyter server log files to prevent unauthorized access.
chmod 600 /path/to/jupyter/logs/*
chown root:root /path/to/jupyter/logs/*
Disable Detailed Error Logging
allConfigure Jupyter to not log sensitive headers and cookies in error responses.
jupyter notebook --generate-config
Edit config file to set c.ServerApp.log_format to exclude sensitive headers
🧯 If You Can't Patch
- Implement strict access controls on server log directories to prevent unauthorized reading
- Monitor server logs for suspicious access patterns and implement alerting for 5xx error spikes
🔍 How to Verify
Check if Vulnerable:
Check Jupyter Notebook version with 'jupyter notebook --version'. If version is less than 6.4.9, the system is vulnerable.
Check Version:
jupyter notebook --version
Verify Fix Applied:
Run 'jupyter notebook --version' and confirm version is 6.4.9 or higher. Test by triggering a 5xx error and checking logs for sensitive header exposure.
📡 Detection & Monitoring
Log Indicators:
- Unauthorized access to Jupyter log files
- Spike in 5xx errors from Jupyter server
- Log entries containing 'Cookie:' or 'Authorization:' headers
Network Indicators:
- Multiple failed requests triggering 5xx errors from single source
- Unusual authentication attempts following error spikes
SIEM Query:
source="jupyter.logs" AND (status>=500 AND status<600) | stats count by src_ip