Executive brief
JupyterLab Git is an extension that allows users to manage Git repositories directly within the JupyterLab interface. A security flaw in how the extension displays renamed files allows an attacker to execute malicious code on a user's machine. By tricking a user into viewing the history of a specially crafted filename in a shared repository, an attacker can gain full control over the user's JupyterLab environment, potentially stealing sensitive data, credentials, or executing arbitrary commands.
Technical details
A stored cross-site scripting (XSS) vulnerability exists in the `PlainTextDiff.ts` component of the jupyterlab-git extension. The `createHeader()` method improperly handles Git filenames by passing them directly to `innerHTML` without sanitization when rendering diffs for renamed files in the commit history. An attacker can exploit this by committing a file with a malicious JavaScript payload in its filename (e.g., using an `onerror` attribute in an `img` tag) and then renaming it. When a victim views the rename diff in the Git History tab, the payload executes. In the context of JupyterLab, this XSS can be escalated to Remote Code Execution (RCE) by using the injected script to steal the XSRF token and interact with the JupyterLab Terminal API. The issue is fixed in version 0.54.0 by ensuring filenames are rendered safely.
Affected products
- jupyterlab jupyterlab-git >= 0.30.0b3, < 0.54.0
- npm @jupyterlab/git >= 0.30.0b3, < 0.54.0
Timeline
- 2026-06-17: patched: Version 0.54.0 released
- 2026-06-18: advisory: GitHub Security Advisory published
- 2026-07-08: disclosed: CVE-2026-54527 published to NVD