CVE-2021-32797 JupyterLab: XSS due to lack of sanitization of the action attribute of an html <form>
Attackers can execute arbitrary code by crafting malicious notebooks that exploit unsanitized form action attributes, requiring user interaction to open the file.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-32797?
CVE-2021-32797 is a high-severity cross-site scripting vulnerability in jupyterlab, published on 9 Aug 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
JupyterLab is a user interface for Project Jupyter which will eventually replace the classic Jupyter Notebook. In affected versions untrusted notebook can execute code on load. In particular JupyterLab doesn’t sanitize the action attribute of html `<form>`. Using this it is possible to trigger the form validation outside of the form itself. This is a remote code execution, but requires user action to open a notebook.
Weakness: CWE-79
Which versions are affected by CVE-2021-32797?
17 open source packages ship an affected version, including jupyterlab and notebook. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
jupyterlab Bitnami | All versions | 1.2.21, 2.2.10, 2.3.2, 3.0.17, 3.1.4 |
jupyterlab PyPI | All versions | 1.2.21, 2.2.10, 2.3.2, 3.0.17, 3.1.4 |
jupyterlab PyPI | All versions | 1.2.21 |
jupyterlab PyPI | All versions | 1.2.21 |
jupyterlab PyPI | From 2.0.0a0 | 2.2.10 |
jupyterlab PyPI | From 2.0.0a0 | 2.2.10 |
11 more packages
jupyterlab PyPI | From 2.3.0a0 | 2.3.2 |
jupyterlab PyPI | From 2.3.0a0 | 2.3.2 |
jupyterlab PyPI | From 3.0.0a0 | 3.0.17 |
jupyterlab PyPI | From 3.0.0a0 | 3.0.17 |
jupyterlab PyPI | From 3.1.0a0 | 3.1.4 |
jupyterlab PyPI | From 3.1.0a0 | 3.1.4 |
notebook PyPI | All versions | 5.7.11, 6.4.1 |
notebook PyPI | All versions | 5.7.11 |
notebook PyPI | All versions | 5.7.11 |
notebook PyPI | From 6.0.0 | 6.4.1 |
notebook PyPI | From 6.0.0 | 6.4.1 |
Linux distribution packages (2)
python-jupyterlab SUSE:Package Hub 15 SP4 | All versions | 2.2.10-bp154.2.3.1 |
python-jupyterlab openSUSE:Leap 15.4 | All versions | 2.2.10-bp154.2.3.1 |
Products include Jupyter Jupyterlab.
How do I fix CVE-2021-32797?
Upgrade jupyterlab to a fixed version for your release line: 1.2.21, 2.2.10, 2.3.2 or 3.0.17.
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-32797 being exploited?
There is no known exploitation of CVE-2021-32797 in the wild and no public exploit code.
Other vulnerabilities in jupyterlab
- CVE-2024-39700 Remote Code Execution (RCE) vulnerability in jupyterlab extension template `update-integration-tests` GitHub Action
- CVE-2026-42266 JupyterLab has an Extension Manager API/GUI Policy Discrepancy, allowing 3rd party (malicious) extensions install via POST request
- CVE-2026-42557 jupyterlab: Command linker attributes in HTML enable one-click command execution from untrusted content
- CVE-2024-43805 HTML injection in Jupyter Notebook and JupyterLab leading to DOM Clobbering
- CVE-2025-59842 JupyterLab LaTeX typesetter links did not enforce `noopener` attribute
Sources
Also known as BIT-jupyterlab-2021-32797, GHSA-4952-p58q-6crx, MGASA-2023-0060, PYSEC-2021-130, PYSEC-2026-688, openSUSE-SU-2022:10075-1.