Skip to content
XSS Advisory Intermediate CVE-2021-32862

GHSL-2021-1013_1028: Arbitrary code injection in nbconvert leads to several Cross-Site Scripting (XSS) vulnerabilities - CVE-2021-32862

nbconvert failed to escape several notebook metadata and output fields when generating HTML, allowing an attacker who controls a notebook to inject arbitrary HTML and JavaScript. If the resulting HTML is served by a web server such as nbviewer, this leads to cross-site scripting.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

When using nbconvert to generate an HTML version of a user-controllable notebook, it is possible to inject arbitrary HTML which may lead to Cross-Site Scripting (XSS) vulnerabilities if these HTML notebooks are served by a web server (eg: nbviewer)

pwntester, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could run arbitrary JavaScript in the browser of a user viewing a generated HTML notebook, which could lead to cross-site scripting if the notebook is served by a web server.

What the attacker needed

Attacker controls notebook content; victim views generated HTML notebook

The fix

The issue was fixed in version 6.3, which escapes the affected fields.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A notebook is a file that can contain text, code and output. When a tool turns it into a web page, some parts of the notebook were inserted into the page without being made safe. That let someone put their own script into the page, and the script would run in the browser of anyone who viewed it.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Alvaro Muñoz

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.