---
id: CVE-2021-32798
aliases:
  - GHSA-hwvq-6gjx-j797
  - BIT-jupyter-base-notebook-2021-32798
  - BIT-jupyter-notebook-2021-32798
  - PYSEC-2021-118
title: Special Element Injection in notebook
summary: Special Element Injection in notebook
severity: critical
cvss: 10
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N'
vendor: notebook
product: notebook
ecosystem: pip
affected:
  - notebook < 5.7.11
  - 'notebook >= 6.0.0, < 6.4.1'
patched:
  - notebook 5.7.11
  - notebook 6.4.1
published: '2021-08-23'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:49:27.336198181Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-hwvq-6gjx-j797'
references:
  - url: >-
      https://github.com/jupyter/notebook/security/advisories/GHSA-hwvq-6gjx-j797
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2021-32798'
  - url: >-
      https://github.com/jupyter/notebook/commit/79fc76e890a8ec42f73a3d009e44ef84c14ef0d5
  - url: 'https://github.com/jupyter/notebook'
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/notebook/PYSEC-2021-118.yaml
tags:
  - osv
  - pip
epss: 0.02106
epssPercentile: 0.80941
ingestedAt: '2026-09-12T03:13:01.703Z'
---

## Overview

### Impact

Untrusted notebook can execute code on load. This is a remote code execution, but requires user action to open a notebook.

### Patches

5.7.11, 6.4.1

### References

[OWASP Page on Injection Prevention](https://cheatsheetseries.owasp.org/cheatsheets/Injection_Prevention_Cheat_Sheet.html#injection-prevention-rules)

### For more information

If you have any questions or comments about this advisory, or vulnerabilities to report, please email our security list security@ipython.org.

Credit: Guillaume Jeanne from Google


### Example:

A notebook with the following content in a cell and it would display an alert when opened for the first time in Notebook (in an untrusted state):

```
{ "cell_type": "code", "execution_count": 0, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<select><iframe></select><img src=x: onerror=alert('xss')>\n"], "text/plain": [] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "" ] }
````

## Affected packages

- `notebook < 5.7.11`
- `notebook >= 6.0.0, < 6.4.1`

## Remediation

Upgrade to a patched release:

- `notebook 5.7.11`
- `notebook 6.4.1`
