CVE-2022-24758

7.5 HIGH

📋 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

Products:
  • Jupyter Notebook
Versions: All versions prior to 6.4.9
Operating Systems: All operating systems running Jupyter Notebook
Default Config Vulnerable: ⚠️ Yes
Notes: All default installations are vulnerable. The vulnerability requires 5xx errors to be triggered to expose sensitive data in logs.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH - Internet-facing Jupyter servers are directly accessible to attackers who can trigger 5xx errors and access logs.
🏢 Internal Only: MEDIUM - Internal attackers or compromised accounts can still exploit this if they have access to server logs.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

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

linux

Set 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

all

Configure 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

🔗 References

📤 Share & Export