Jupyter Server is the backend for Jupyter web applications. Prior to 2.20, the nbconvert HTTP handlers in jupyter_server render user-authored notebook HTML under the Jupyter origin without a sandbox directive in their Content-Security-Policy. Combined with nbconvert.HTMLExporter's default non-sanitizing behavior, a notebook carrying an HTML payload in a display_data output triggers stored XSS with cookie access, full /api/* authority, and kernel RCE. This vulnerability is fixed in 2.20.
HTTP handlers of the nbconvert module in jupyter_server render HTML content authored by users in the context of the Jupyter domain without a sandbox directive in the Content-Security-Policy header. The default behavior of nbconvert.HTMLExporter does not sanitize notebook content, allowing malicious JavaScript code to be embedded in the display_data field of cell output. When a victim opens such a notebook through the web interface, the XSS payload executes in the privileged context of the Jupyter origin, giving the attacker access to the session, API, and the ability to remotely execute code through the kernel.
An attacker can hijack a user session through cookie theft, execute arbitrary requests to /api/* with the victim's full permissions, and remotely execute code (kernel RCE) on the Jupyter server.
Jupyter Server should be updated to version 2.20 or newer, where the vulnerability has been fixed. The patch is available in the project repository (commit 6cbee8d65e71abac851c4492fea987ad080580bd).
Jupyter Server in versions before 2.20
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XJupyter Server
APPJupyter< 2.20.0
Related vulnerabilities
A vulnerability in jupyter-server versions 1.12.0 through 2.17.0 allows an attacker to bypass CORS origin vali...
A path traversal vulnerability exists in jupyter-server version 2.17.0 due to an incorrect root directory boun...
Jupyter Server is the backend for Jupyter web applications. In versions 2.17.0 and earlier, the Origin header ...
Jupyter Server is the backend for Jupyter web applications. In versions 2.17.0 and earlier, the secret used to...
Jupyter Server is the backend for Jupyter web applications. In versions 2.17.0 and earlier, a path traversal v...