Special Element Injection in notebook
High10.0CVE-2021-32798 · Published Aug 23, 2021 · updated Sep 10, 2026
### 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 versions
| Package | Affected | Fixed in |
|---|---|---|
| notebook PyPI | < 5.7.11 | 5.7.11 |
| >= 6.0.0, < 6.4.1 | 6.4.1 |
Details and references
More Jupyter advisories
All Jupyter| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| May 142022 | Improper Neutralization of Input During Web Page Generation in Jupyter Notebook | Medium5.4 | 5.7.6 |
| Apr 52022 | Sensitive Auth & Cookie data stored in Jupyter server logs | High7.5 | 6.4.10 |
| Mar 252022 | Insertion of Sensitive Information into Log File in Jupyter notebook | High7.5 | 1.15.4 |
| Nov 82021 | incomplete JupyterHub logout with simultaneous JupyterLab sessions | Medium3.5 | 1.5.0 |
| Aug 232021 | JupyterLab: XSS due to lack of sanitization of the action attribute of an html <form> | Medium7.4 | 1.2.21+6 more |
| Dec 212020 | Jupyter Server open redirect vulnerability | Medium6.1 | 1.1.1 |