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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.4
- **CVSS:** 7.4 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: Required; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: None; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 2.66% (percentile 86, 2026-11-26)
- **CWE:** CWE-79
- **Aliases:** BIT-jupyterlab-2021-32797, GHSA-4952-p58q-6crx, PYSEC-2021-130, PYSEC-2026-688
- **Published:** 2021-08-09T20:45:10.000Z
- **Modified:** 2026-07-08T06:28:37.707Z

## Who should check

- Projects that depend on PyPI package jupyterlab (\< 1.2.21)
- Projects that depend on PyPI package notebook (\< 5.7.11)
- Anyone running jupyterlab \>= 3.1.0, \< 3.1.4; \>= 3.0.0, \< 3.0.17; \>= 2.3.0, \< 2.3.2; \>= 2.0.0, \< 2.2.10; \< 1.2.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.

## Affected and fixed versions

- PyPI `jupyterlab`: affected \< 1.2.21; fixed 1.2.21, 2.2.10, 2.3.2, 3.0.17, 3.1.4 (osv)
- PyPI `notebook`: affected \< 5.7.11; fixed 5.7.11, 6.4.1 (osv)
- jupyterlab: \>= 3.1.0, \< 3.1.4; \>= 3.0.0, \< 3.0.17; \>= 2.3.0, \< 2.3.2; \>= 2.0.0, \< 2.2.10; \< 1.2.1 (cvelist)

## Mitigation

- Upgrade jupyterlab to one of 1.2.21, 2.2.10, 2.3.2, 3.0.17, 3.1.4 (or later in the same release line).
- Upgrade notebook to one of 5.7.11, 6.4.1 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-32797. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-32797.md
Affected: jupyterlab < 1.2.21; notebook < 5.7.11
Fixed in: 1.2.21, 2.2.10, 2.3.2, 3.0.17, 3.1.4, 5.7.11, 6.4.1

Steps:
1. Search this machine and project for jupyterlab (PyPI), notebook (PyPI), jupyterlab: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-32797 being exploited?

There is no confirmed exploitation: CVE-2021-32797 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 2.66% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-32797?

High: CVSS 7.4 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2021-32797?

jupyterlab \< 1.2.21; notebook \< 5.7.11.

### Is there a fix for CVE-2021-32797?

Yes. Fixed in 1.2.21, 2.2.10, 2.3.2, 3.0.17, 3.1.4, 5.7.11, 6.4.1. Upgrade jupyterlab to one of 1.2.21, 2.2.10, 2.3.2, 3.0.17, 3.1.4 (or later in the same release line). Upgrade notebook to one of 5.7.11, 6.4.1 (or later in the same release line).

### How do I check if I'm affected by CVE-2021-32797?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/jupyterlab/jupyterlab/security/advisories/GHSA-4952-p58q-6crx>
- vendor: <https://github.com/google/security-research/security/advisories/GHSA-c469-p3jp-2vhx>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-32797>
- vendor: <https://github.com/advisories/GHSA-4952-p58q-6crx>
- patch: <https://github.com/jupyterlab/jupyterlab/commit/504825938c0abfa2fb8ff8d529308830a5ae42ed>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/jupyterlab/PYSEC-2021-130.yaml>
- other: <https://pypi.org/project/notebook>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-32797>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-4952-p58q-6crx> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2021-130> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-688> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-32797> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-32797>
