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

Critical 10.0 Published Updated

An attacker can execute arbitrary code on a victim's computer by tricking them into opening a malicious notebook file due to insufficient input sanitization.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-32798?

CVE-2021-32798 is a critical cross-site scripting vulnerability in jupyter notebook, published on 9 Aug 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-79

Which versions are affected by CVE-2021-32798?

7 open source packages ship an affected version, including jupyter-base-notebook, jupyter-notebook and notebook. It affects 1 product.

PackageAffectedFixed in
jupyter-base-notebook BitnamiFrom 5.7.05.7.11, 6.4.1
jupyter-notebook BitnamiFrom 5.7.05.7.11, 6.4.1
notebook PyPIAll versions5.7.11
notebook PyPIAll versions5.7.11
notebook PyPIFrom 5.7.05.7.11
notebook PyPIFrom 6.0.06.4.1
1 more packages
notebook PyPIFrom 6.0.06.4.1

Products include Jupyter Notebook.

How do I fix CVE-2021-32798?

Upgrade jupyter-base-notebook to a fixed version for your release line: 5.7.11 or 6.4.1.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2021-32798 being exploited?

There is no known exploitation of CVE-2021-32798 in the wild and no public exploit code.

Sources

Also known as BIT-jupyter-base-notebook-2021-32798, BIT-jupyter-notebook-2021-32798, DEBIAN-CVE-2021-32798, GHSA-hwvq-6gjx-j797, PYSEC-2021-118, UBUNTU-CVE-2021-32798.

Is CVE-2021-32798 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free