CVE-2021-32798

10.0 CRITICAL

📋 TL;DR

CVE-2021-32798 is a critical vulnerability in Jupyter Notebook that allows malicious notebook files to execute arbitrary JavaScript code when opened. This cross-site scripting (XSS) vulnerability can lead to remote code execution on the victim's system through Jupyter APIs. All users running affected versions of Jupyter Notebook are vulnerable.

💻 Affected Systems

Products:
  • Jupyter Notebook
Versions: Versions before 6.4.0
Operating Systems: All operating systems running Jupyter Notebook
Default Config Vulnerable: ⚠️ Yes
Notes: All Jupyter Notebook installations using the default configuration are vulnerable. The vulnerability exists in the notebook sanitization mechanism.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the Jupyter Notebook server allowing attacker to execute arbitrary commands, access sensitive data, and potentially pivot to other systems.

🟠

Likely Case

Attacker gains code execution within the Jupyter Notebook context, potentially accessing user data, installing malware, or using the server for further attacks.

🟢

If Mitigated

No impact if patched or proper network segmentation prevents malicious notebook upload/execution.

🌐 Internet-Facing: HIGH - Internet-facing Jupyter Notebook instances are directly exploitable by uploading malicious notebooks.
🏢 Internal Only: HIGH - Internal users can still exploit by sharing malicious notebooks or if internal systems are compromised.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires the victim to open a malicious .ipynb notebook file. Public proof-of-concept exists and the vulnerability is actively exploited.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.4.0 and later

Vendor Advisory: https://github.com/jupyter/notebook/security/advisories/GHSA-hwvq-6gjx-j797

Restart Required: Yes

Instructions:

1. Update Jupyter Notebook using pip: 'pip install --upgrade notebook>=6.4.0' 2. Restart the Jupyter Notebook server 3. Verify the version with 'jupyter notebook --version'

🔧 Temporary Workarounds

Disable notebook execution

all

Temporarily disable opening of untrusted notebook files

jupyter notebook --NotebookApp.disable_check_xsrf=True --NotebookApp.token='' --NotebookApp.password=''

🧯 If You Can't Patch

  • Restrict Jupyter Notebook access to trusted users only
  • Implement network segmentation to isolate Jupyter Notebook from sensitive systems

🔍 How to Verify

Check if Vulnerable:

Check Jupyter Notebook version: 'jupyter notebook --version'. If version is below 6.4.0, the system is vulnerable.

Check Version:

jupyter notebook --version

Verify Fix Applied:

Verify version is 6.4.0 or higher: 'jupyter notebook --version' should show 6.4.0+

📡 Detection & Monitoring

Log Indicators:

  • Unusual notebook file uploads
  • Suspicious JavaScript execution in notebook logs
  • Unexpected system commands executed from notebook context

Network Indicators:

  • Unusual outbound connections from Jupyter Notebook server
  • Download of suspicious notebook files

SIEM Query:

source="jupyter" AND (event="notebook_execution" OR event="file_upload") AND suspicious_patterns

🔗 References

📤 Share & Export